File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Combobox lookup in a Jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Combobox lookup in a Jtable " Watch "Combobox lookup in a Jtable " New topic
Author

Combobox lookup in a Jtable

Gene Hilpert
Ranch Hand

Joined: May 22, 2002
Posts: 50

I have been looking for the past few days on how to use a lookup comboxbox.
By that I mean the combobox has a value and a discription. When the user picks from the combobox they see the discription but the value is stored
in the cell. I can get the combobox to display with the discription. But when not editing the column show the value not the discription.

I just cant seam to get the renderer to work

Any hints, examples or places to look?

Thanks
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19538
    
  16

There obviously is a relation between the value and the description, and you can use this.

When creating the combo box, give it a renderer that displays the description:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Gene Hilpert
Ranch Hand

Joined: May 22, 2002
Posts: 50

Thanks

I thought I had tried what you suggested before - but I must have messed up something else at the same time .

Thanks again

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Combobox lookup in a Jtable
 
Similar Threads
JComboBox in a JTable Cell
How to get the previously selected value in the combo box ?
getting jcombobox mouse over value
Editable JComboBox with Sorting
How.....change combobox1 value ....combobox2 contain value related to that....