Re: Adding Elments to JComboBox
- From: "Adin A via JavaKB.com" <forum@xxxxxxxxxx>
- Date: Wed, 31 Aug 2005 14:34:42 GMT
One way is:
String[] options = { "Bird", "Cat", "Rabbit" };
cmb = new JComboBox(options);
fiqri wrote:
>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
.
- References:
- Adding Elments to JComboBox
- From: fiqri
- Adding Elments to JComboBox
- Prev by Date: Re: UTF-16 encoded HTML
- Next by Date: Re: UTF-16 encoded HTML
- Previous by thread: Re: Adding Elments to JComboBox
- Next by thread: How can I "glue" JDialog to an owning JFrame ?
- Index(es):
Relevant Pages
|
|