Reputation: 195
I was wondering if any of you knows a good method to get the actual JComponent instance rendering a column header in an existing JTable.
Could not find anything helpful on google, so I came here. :)
I already know that there is a TableCellRenderer interface which delivers the component I want to get, but there is no guarantee that it'll return the same instance every time, so it is more or less useless to me.
Edit:
The goal is to have a possibility to get the Location and size of the component representing a column header dynamically.
And by column header component I mean the instance of the following object:
I really can't post any useful code example, sorry.
Actually any JTable example will do, as the problem refers to the standard Java JTable functionality.
Upvotes: 1
Views: 4436
Reputation: 3884
Is table.getColumnModel().getColumn(i).getHeaderRenderer()
what you are looking for?
Upvotes: 1