| Author |
Problem in JTable
|
Vishal Methi
Ranch Hand
Joined: Jan 14, 2004
Posts: 52
|
|
Is it possible in JTable to change the size of a particular row. Actually i have with 10 rows and 10 columns and i want the size of 4th and 8th smaller than other rows......... plz suggest me asap........... Thanx Vishal
|
 |
Jason Steele
Ranch Hand
Joined: Apr 25, 2003
Posts: 100
|
|
you would have to extend JLabel and implement DefaultTableModel or extend AbstractTableModel. Preferrable the second option. Then in the getTableCellRendererComponent method, test to see if you are in row 4 or 8...or better yet row % 4 == 0. If it is, then call setPreferredSize on that label to be the size you desire. Good Luck!
|
An egg is a chicken's house!
|
 |
Jose Botella
Ranch Hand
Joined: Jul 03, 2001
Posts: 2120
|
|
|
JTable.setRowHeight(row, rowHeight) is another possibility.
|
SCJP2. Please Indent your code using UBB Code
|
 |
 |
|
|
subject: Problem in JTable
|
|
|