aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JComboBox Help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JComboBox Help!" Watch "JComboBox Help!" New topic
Author

JComboBox Help!

ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
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

Joined: May 15, 2001
Posts: 673
Try changing

to this
Regards
Nigel
ben riches
Ranch Hand

Joined: Nov 08, 2002
Posts: 126
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

Joined: May 15, 2001
Posts: 673
Yes sorry I hadn't read your code properly. The argument should be the name of your JCombo e.g.

Regards
Nigel
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JComboBox Help!