• Post Reply Bookmark Topic Watch Topic
  • New Topic

Combobox show one list but show different value once selected

 
Geoff Berl
Greenhorn
Posts: 24
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • 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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • 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()
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!