• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Combobox show one list but show different value once selected

 
Greenhorn
Posts: 24
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure if that title made any sense but it's the best I could come up with. I have a CellEditor for my table that is a Combobox



And here is Operation:


So, I have my cell showing a combobox when clicked and it shows the operation Number and Description. Once selected I want the Combobox AND the table value to represent only the number. Basically this is just to allow the user to easily see what number correlates to what process step but only during the actual selection. The result should only display the number though.

I've been trying all sorts of different things but I can't seem to get it to work.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just thinking out loud here.

if the comboBox only displays 'Operations' (public OperationsCellEditor(String[] items) --> could be a problem),
maybe this might work:
1) add a field to Operation()
boolean selected = false;
2) add (or add to) a listener - when an operation is selected - change that operation's 'selected' to true
3) add the indicated line to Operation's toString()
reply
    Bookmark Topic Watch Topic
  • New Topic