Hi All,
I am new to java gui. My requirement is to add elements to jcombobox
with respective values. For an example: I need to display servarl names
in the list if a list item selected a value or an id assigned to it
should out put.
in html i can do this
<select name=cmb>
<option value=100>Bird</option>
<option value=200>Cat</option>
<option value=300>Rabbit</option>
</select>
if you select "Bird" 100 is displayed
i need to accomplish this task using java and jcombobox.
please help on this.
thankx
Thomas Weidenfeller - 31 Aug 2005 09:06 GMT
> I am new to java gui. My requirement is to add elements to jcombobox
> with respective values.
Sun's tutorials are at
http://java.sun.com/docs/books/tutorial/uiswing/learn/index.html
http://java.sun.com/docs/books/tutorial/uiswing/index.html
Please read them. There are more pointers in the FAQ, yu might want to
read them, too.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/
Roedy Green - 31 Aug 2005 11:31 GMT
>i need to accomplish this task using java and jcombobox.
see http://mindprod.com/jgloss/jcombobox.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Adin A - 31 Aug 2005 15:34 GMT
One way is:
String[] options = { "Bird", "Cat", "Rabbit" };
cmb = new JComboBox(options);
>Hi All,
>
[quoted text clipped - 18 lines]
>
>thankx