Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems with JTable. Need help!!  RSS feed

Raul Quintero
Posts: 7
  • Mark post as helpful
  • send pies
  • 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.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!