• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying the number of rows displayed in a JTable

 
George Lawniczak
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am just wondering if there is a way to easily get the number of rows being displayed in a JTable. The idea is that I would like to have on the top of the table a message stating something like, "Displaying rows 1 to 20 of 40", and it can change if the user scrolls or resizes the window.
I guess using Powerbuilder for the last 7 years has made me spoiled. Stuff like that with PB was a snap.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure, but it won't add points to your grade, so you don't need to have it in there.
I know it is a nice feature, but if you don't want to spend to much time on it, it is A OK to leave it out.
Good Luck in finding a solution for this.
Mark
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mark Spritzler:
Good Luck in finding a solution for this.

Ain't that the truth. I spent fiftenn minutes looking at JTable, JScrollPane and JViewport. It can be done but I wouldn't want to do it. I don't know if you could ever make it absolutely deterministic.
Michael Morris
 
Sarita Gupta
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi George
I think it's too much effort involved for just displaying a simple message... so if u'd me I'd rather not implements as such. Besides the main idea of this assignment is to test your design skill. This by itself doesn't help much...
Sarita
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic