File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

customizng JTableHeader

subhadeep mandal

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.
I agree. Here's the link:
subject: customizng JTableHeader
It's not a secret anymore!