Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding JComboBox to JTable header

 
Yasushi Okubo
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldl like to add JComboBox to JTable header so that a user can choose a different header name for each column in JTable. I tried to create a class extends JComboBox and implements TableCellRenderer, but it only showed the first entry, then does not show all other items ( I mean it does not extend a cell window to display others by clicking).

Could someone give me a direction ? It looks like the header in JTable cannot be treated like a regular cell. I would like to know how to get around this problem.

Thanks,
yasushi
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!