GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes customizng JTableHeader Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "customizng JTableHeader " Watch "customizng JTableHeader " New topic
Author

customizng JTableHeader

subhadeep mandal
Greenhorn

Joined: Dec 15, 2004
Posts: 1
I want to customize a partcular columnheader of a JTable such that the columnheader will be displayed as a panel which contains more than one JLabels in a Border/GridLayout maneger
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
Make a class that implements TableCellRenderer and equip it to return your JPanel as the renderer component. Get the TableColumn from the TableColumnModel of the table and then set your renderer on it with setHeaderRenderer.
 
jQuery in Action, 2nd edition
 
subject: customizng JTableHeader