• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Marshal
Posts: 79177
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about a label across the bottom of the display (BorderLayout.PAGE_END/SOUTH)?
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well done
 
reply
    Bookmark Topic Watch Topic
  • New Topic