JComboBox problem, pse help!

From: Tobi Krausl (javasmani_at_yahoo.de)
Date: 11/27/03


Date: 27 Nov 2003 00:50:31 -0800

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


Quantcast