How to get Visible Row Count in JTable?
Hi All,
I have one table which is added to one scroll pane. For example my table have total 100 rows, but at a time only 10 rows are visible to the scroll pane. I want to know how to get that number which represents the visible row( in this case it is 10). I use BorderLayout as a Layout Manager. I tried every function for getting height of table but it gives me total height , i.e in this example total height for 100 rows. So kindly help me how to get visible row count. Any help regarding this will be appriciated.
Thanx and Regards,
Premal Panchal
Re: How to get Visible Row Count in JTable?
I don't think you'll find a method that gives you the visible row count, but it will be the scrollpane viewport height divided by the table row height (unless the table is too small to fill the viewport, in which case it will be the total row count).
Good judgment comes from experience; experience comes from bad judgment...
F. Brooks