• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JComboBox Help!

 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try changing

to this
Regards
Nigel
 
ben riches
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Get me the mayor's office! I need to tell him about this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic