T
Tobi Krausl
Hi,
I've a question concerning JComboBox:
In my program a use a JComboBox which is initialized with a list of
values at program startup. During runtime, this JComboBox is editable
so that a user can enter his own values.
I want to do following: After the user entered a valued in the
textfield of the JComboBox and a button is pressed, there should be
checked whether the JComoBox already contains the entered value. If
so, fine! If not, JComboBox.addItem(...entered value...).
How can I check whether a JComboBox or its related model already
contains a certain value??
Obviously there's no method like JComboBox.contains(Object o) or
JComboBox.getModel().contains(Object o)?!
Thank you,
Tobi
I've a question concerning JComboBox:
In my program a use a JComboBox which is initialized with a list of
values at program startup. During runtime, this JComboBox is editable
so that a user can enter his own values.
I want to do following: After the user entered a valued in the
textfield of the JComboBox and a button is pressed, there should be
checked whether the JComoBox already contains the entered value. If
so, fine! If not, JComboBox.addItem(...entered value...).
How can I check whether a JComboBox or its related model already
contains a certain value??
Obviously there's no method like JComboBox.contains(Object o) or
JComboBox.getModel().contains(Object o)?!
Thank you,
Tobi