jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes MultiLine Headers with Icons for a JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "MultiLine Headers with Icons for a JTable" Watch "MultiLine Headers with Icons for a JTable" New topic

MultiLine Headers with Icons for a JTable

Neha D
Ranch Hand

Joined: Oct 12, 2004
Posts: 32

I want multi line headers for a table with header icons. For multiline headers I am extending the renderer class to a JList & it implements the TableCellRenderer interface.

The problem is, it is showing me the multiline header for each column but when I click on any one of the headers it shows me the same icon twice for a single header. Is there any way out wherein I can just display the icon once on a mouse click.

I think the problem is b'coz the renderer is being called twice - once when the table is initialised for showing the multi line header & the other on a mouse click for displaying the icon.

Can anyone suggest me as to why is this happening...

Any help will be appreciated..


Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
I agree. Here's the link: http://aspose.com/file-tools
subject: MultiLine Headers with Icons for a JTable
It's not a secret anymore!