Forums Register Login

Combobox lookup in a Jtable

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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:
+Pie Number of slices to send: Send
Thanks

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

Thanks again

Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1171 times.
Similar Threads
How to get the previously selected value in the combo box ?
getting jcombobox mouse over value
How.....change combobox1 value ....combobox2 contain value related to that....
Editable JComboBox with Sorting
JComboBox in a JTable Cell
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:23:19.