• Post Reply Bookmark Topic Watch Topic
  • New Topic

Append always visible JTable "footer" at the bottom of the table  RSS feed

 
Jonas Kazlauskas
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I am building a little application for personal use where I can track my finance. Now, what I would like to get is an always visible JTable "footer" OR horizontal space field attached to the bottom of the window. The idea is that scrolling down/up wouldn't affect it's visibility(like JTable header). Might a picture tell a thousand words: see attachment.
I am wondering, maybe JTable OR TableModel class has a property to solve this problem(I haven't found any)? Or shall I make another ScrollPane/JPanel? Any suggestions which path of search shall I pursue?
Tablefooter1.png
[Thumbnail for Tablefooter1.png]
 
Campbell Ritchie
Sheriff
Posts: 53719
127
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about a label across the bottom of the display (BorderLayout.PAGE_END/SOUTH)?
 
Campbell Ritchie
Sheriff
Posts: 53719
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may need a listener on the table to do the summation and update that display at the bottom.
Can you create a table model object with a total field?
 
Jonas Kazlauskas
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, it seems that I found the solution. I used BorderLayout for my JPanel; created JLabel and added it at the page end:
 
Campbell Ritchie
Sheriff
Posts: 53719
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!