Visuals...determining the right table column size, gui size ?
Karl Fu
Ranch Hand
Joined: Mar 26, 2001
Posts: 41
posted
0
how do you determine the right column size for each row? i tried to use the formula "fields.length * CONSTANT" for each column's width..but not every column's heading will have enough space to be displayed. If i increase the constant to give space to show all columns, then my gui will almost covered up my entired screen...and the carrier column will have too many space wasted. Any suggestion ? I also tried to format the column header into 2 rows if they are composite of 2 or more words....but the display remains unchanged. How do i accomplish that ? Thanks in advance Karl
Narayan Veeramani
Greenhorn
Joined: Jun 06, 2001
Posts: 25
posted
0
For having multiple lines on the column header in the JTable, you need to use the cell renderer object associated with the table header of the JTable. You can get the renderer as follows and then perform the column header rendering. TableCellRenderer headerRenderer = table.getTableHeader(). getDefaultRenderer();
subject: Visuals...determining the right table column size, gui size ?