Help coderanch get a
new server
by contributing to the fundraiser
  • 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 ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Problems with JTable. Need help!!

Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JTable that is created with my own table renderer. It sits in a panel, which sits in another panel. This parent panel controls all the actions done with the table and trees and buttons etc. Within the table, I "hide" a column by setting the min/max/perferred width to 0. The problem I am having is: When a user clicks on an object in the tree, the table is supposed to display that objects information. The first time around, the table is displayed with all columns the same width (this is not supposed to happen), then the next time a user clicks on another object, the table displays the info with the correct widths but.....
1. the column widths do not maintain the widths that the user wants. i.e. when a column is dragged to be larger in width, it is lost with the next table change
2. The table background doesn't seem to change with the dimensions of the table when an object is choosen from the tree. What I mean by this is: the first time around the table's total width is say 500 (all column widths combined). The next time the table is displayed, it's total width is 550, what it should be, but the last column is only rendered on the screen to be 500. So, the column headers are 550 in total width, but the columns themselves only paint to 500. Only when the user drags the last column's border to resize it will the table column itself repait to fit the table.
3. After navigating for a while, clicking on multiple objects, displaying multiple versions of the table, I "lose" the last column. It disappears and the only way to get it back is to start the application all over again.
I know this is pretty complicated, and was hard for me just to try to write this down and explain what the problems are.

This is my favorite show. And this is my favorite tiny ad:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic