wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Choice choice = new Choice(); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Choice choice = new Choice();" Watch "Choice choice = new Choice();" New topic
Author

Choice choice = new Choice();

Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
As you can probably see... i'm having a problem with Choice. I have an arraylist already set up basically of items in a specific room and different items in another item. How can I put that into a choice.add(itemArrayList);? I thought I had my code right but apparently it couldn't be read. Does anybody know of a tutorial I can refer to for adding ArrayLists to a Choice?


Live And Let Learn.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What is a Choice? What API?


GenRocket - Experts at Building Test Data
Martin vanPutten
Ranch Hand

Joined: Mar 26, 2006
Posts: 124
Choice gives you a drop down menu.
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
What is a Choice?
An AWT component, antecedant to the JComboBox.
Does anybody know of a tutorial I can refer to for adding ArrayLists to a Choice?
Your best bet is to check the api. It has an add method that takes a String argument. Without generics, you might populate your Choice like this:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Choice choice = new Choice();