I have this Frmae that should show tables inside another Panel with GridBagLayout. Part of the code is here. Problem is that the tables show up as white areas with border and they are not populated when a button for the same is pressed (code not included here), though the tablemodels are properly populated (debug statments tell me that). Any flaw with this code?
[ September 22, 2004: Message edited by: Debashish Chakrabarty ]
I have two TableModels associated with these tables.
The data changes (search logic) and tables need to be repopulated on each button press.
There are no tables headers to display (I tried getting rid of scroll pane on this account, but tables still show no data)
While I am able to run the above said code as a Frame and some modified code as JInternal Frame and using a TableModel. I am still not able to populate the data in my tables in the project code. The tables need to be populated with data that I feed in the models and call fireTableDataChanged(). The TableChanged event is called religiously after this, my debug statements tell me that Models have the data. But still the Tables would display nothing. The whole Table area is a big White box with border, nothing else.
Any one who could help me get out of this quagmire? [ September 22, 2004: Message edited by: Debashish Chakrabarty ]
I guess the reason the table was not displaying was that I was not doing this:
Now to the new problem: Though I have set the "Preferred sizes" of both tables as same, the code is identical for both the tables, yet the Header table displays in its full glory with width as I defined, but Detail one is shrinked to a few pixels. I could see that data is there in the cells when I click on them (the column shows it as "...").
Basically, the idea is each column of Header table, the checkbox below and the corresponding column in the detail below should be in one vertical plane or line (seemingly a single table having 12 columns).
I wonder that when the code is identical for both tables what makes one of the tables to appear shrinked at the center of the Scroll Pane.
Any help on this would be appreciated. Thanks for your time. [ September 22, 2004: Message edited by: Debashish Chakrabarty ]
Joined: Jan 14, 2004
Components will collapse to 10 x 10 when there isn't enough room for them to be displayed in a GridBagLayout. I would try dragging the top/bottom and sides of the JInternalFrame until the JTable opens up. Another thing to try is to get a readout in the console (System.out.println) of its preferred size after the call to setVisible at the end of the constructor to find out what size it needs for display.