Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Icons on JTable header

 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to give icons on the JTable Header clicks.Example Up and Down arrows when clicking on the Headers.
 
Jose Botella
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mathews P Srampikal
Ranch Hand
Posts: 211
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank You.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic