|
-
May 6th, 2005, 11:06 AM
#1
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
-
May 6th, 2005, 02:28 PM
#2
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
Please use [CODE]...your code here...[/CODE] tags when posting code. If you get an error, please post the full error message and stack trace, if present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|