Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JComboBox Help!

 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have posted here in the past about JComboBox and you lot have helped me out greatly. I have one more problem then I can stop nagging you.
the code below puts values from a database into 2 combo boxes, and puts those combo boxes in to the JTabel. when the code is run the cells in the JTable are first of all cells untill I click into a cell it then changes to a Combo Box, I want the JTable to always display each cell as Combo Boxes.
I hope you understand what I mean?
Thanks
Ben

[ March 30, 2004: Message edited by: ben riches ]
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try changing

to this
Regards
Nigel
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Nigel Browne:
Try changing

to this
Regards
Nigel


Hi Nigel,
I have done what you said but I got this error
C:\j21work>javac ComboBoxTable.java
ComboBoxTable.java:98: cannot resolve symbol
symbol : constructor DefaultCellEditor (javax.swing.DefaultCellEditor)
location: class javax.swing.DefaultCellEditor
tcm.getColumn(0).setCellEditor(new DefaultCellEditor(editor2));
^
1 error
Thanks
Ben
 
Nigel Browne
Ranch Hand
Posts: 703
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes sorry I hadn't read your code properly. The argument should be the name of your JCombo e.g.

Regards
Nigel
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic