This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JComboBoxes in JTables  RSS feed

 
Casen Densmore
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to display a jcombobox in a jtable and still have it look exactly like a normal jcombobox.
The problem is my users won't know its a combobox if the arrow isn't there initially. Is there anyway to put an arrow there even if the user doesn't click on the box.
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cell may not be wide enough to show the arrow. Try expanding the width of your column with your mouse (move the header divider) and see if the down arrow shows up. If not, you may need to write a TableCellRenderer to extend JComboBox.
 
Casen Densmore
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DefaultTableModel supports JComboBox just not the way I wanted, you were right, I had to create a CustomTableCellRenderer in order to do the job...Thanks!
Casen
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!