msouphy
asked on
Setting and retrieving hidden value from JComboBox
hey there,
i was wondering, can I set a hidden value on an item in a JComboBox (like an ID or so) so that when an item is selected, the hidden value is returned instead of the item itself.
example:
i get ID, name and first name out of a DB
in a loop, i do a box.additem("name" + " " + first_name);
but i want to set the corresponding ID with that item, somewhere hidden...
like in html it would be <option value="id">name + first_name</option>
Can anyone help, thank you !
i was wondering, can I set a hidden value on an item in a JComboBox (like an ID or so) so that when an item is selected, the hidden value is returned instead of the item itself.
example:
i get ID, name and first name out of a DB
in a loop, i do a box.additem("name" + " " + first_name);
but i want to set the corresponding ID with that item, somewhere hidden...
like in html it would be <option value="id">name + first_name</option>
Can anyone help, thank you !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SecretEntry se = (SecretEntry)comboBox.getS
System.out.println(se.getH