This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Icons on JTable header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Icons on JTable header" Watch "Icons on JTable header" New topic
Author

Icons on JTable header

Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
How to give icons on the JTable Header clicks.Example Up and Down arrows when clicking on the Headers.


Thanks,
Mathews
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
Create a DefaultTableCellRenderer. Because it extends form JLabel set its icon with setIcon method. Then assign it to render the header of a column by TableColumn.setHeaderRenderer.
TableHeader.setDefaultRenderer assigns a TableCellRenderer to any TableColumn on which the method above was not called.


SCJP2. Please Indent your code using UBB Code
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Thank You.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Icons on JTable header
 
Similar Threads
JTable
MultiLine Headers with Icons for a JTable
JTable
JTable
JTable