This week's book / license giveaways are in the JDBC and Relational Databases and Java in General forums.
We're giving away four copies each of PostGIS in Action and Java Advanced Topics Training and have the authors on-line!
See this thread and this one for details.
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


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: 15302
    
    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:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Choice choice = new Choice();