File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find visible row count in JTable?

 
Premal Panchal
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one scroll pane in which i have set one table. Now my problem is to find visible row count in Scroll Pane area. I know that there is no direct function for that. But i tried to find Scroll Pane's height and all other relative functions, but by that way i got total height of Scroll Pane rather than visible area's height. Does anybody know how to find height of visible area of scroll pane? If I find that then I can get visible row count by dividing it to row height. Any help regarding this will apprieated.

Thanx and Regards,
Premal Panchal
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JViewPort is the class which represents the visible portion of a ScrollPane.
 
Premal Panchal
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I tried JViewPort also. But it gives me total hight of ViewPort rather than the visible part of JScrollPane. So is there any other way to do this? I tried all functions related to JViewPort of JScrollPane,JTable. But I couldn't get the proper result.

Thanx and Regards,

PremalPanchal
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Drag the bottom of the JFrame to activate the ComponentListener.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic