Perhaps you can use the setData (String key, Object value) method for combobox to achieve what you want.
Example:
Combo box = new Combo(parent, SWT.DROP_DOWN); String s = "Item 1"; box.add(s); box.setData(s, "Some other info or object here"); s = "Item 2"; box.add(s); box.setData(s, "This is item two"); String value = (String)box.getData("Item 2");
Note that the getData method returns an object. Therefore, you must apply it to the type specified by the setData method.
Because of this, you are not limited to setting strings as your values. You can set any object you want as a value using the setData method. Just make sure that you are doing the right thing when you get the data again using the getData method.
Edit: BTW, you can use the setData and getData methods for any SWT widget.
countcb
source share