CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Post 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

  2. #2
    dlorde is offline Elite Member Power Poster dlorde is a glorious beacon of light (400+) dlorde is a glorious beacon of light (400+) dlorde is a glorious beacon of light (400+) dlorde is a glorious beacon of light (400+) dlorde is a glorious beacon of light (400+) dlorde is a glorious beacon of light (400+)
    Join Date
    Aug 1999
    Location
    UK
    Posts
    10,161

    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.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts



HTML5 Development Center

Click Here to Expand Forum to Full Width