This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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. Thanks