I'm doing SWT program, and I want to know how to hide one item from the combo list.
I know there's a combo.remove()
method, but I don't want to remove the whole data, instead, I just want to "hide" the first item.
For example, there's a list of item[0]=1
, item[1]=2
, item[2]=3
, and the UI used to show the combo with these three items, but now I want to hide the first item, so the combo will only shows "2,3" in the combo list, but item[0]
is still "1" in the database.
You need to move your logic away from storing important data in the GUI ComboBox class.
Use another storage class like ArrayList to hold your data(with possibly another ArrayList to mark which elements should be in the GUI).