Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Adding elements in AWT choice (Combo) boxes in Netbeans

Posted on 2004-09-13
14
Medium Priority
?
3,189 Views
Last Modified: 2008-01-16
What is the best way to add elements in AWT choice boxes in Netbeans IDE 3.6?

Thanks!
0
Comment
Question by:pkrush
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 
LVL 35

Accepted Solution

by:
TimYates earned 1000 total points
ID: 12043762
choice.addItem( "new item" ) ;
0
 

Author Comment

by:pkrush
ID: 12043787
With the GIU designer?

Is using the GIU designer worth it?

Thanks again
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12043813
Ahhh....

for adding the items into the list, I'd do that in code...  Not sure you can do it in the designer (I know you can't in JBuilder)

Use the designer for putting things where you want them, then the code for filling them up :-)

Tim
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Expert Comment

by:zzynx
ID: 12043873
- Select the combo box
- in the properties press the button besides the item "Model"
- the rest should be clear :)
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12043885
Can java.awt.Choice elements have a model?
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12043901
>> in the properties
I mean

In the properties window press the browse ("...") button that is located besides the item "model" (within the "Properties" node)
0
 
LVL 37

Assisted Solution

by:zzynx
zzynx earned 1000 total points
ID: 12044034
Sorry, that was for JComboBox not for AWT choice boxes.
I think you simply can't in netBeans.
You'll have to code it yourself:

Choice ColorChooser = new Choice();
ColorChooser.add("Green");
ColorChooser.add("Red");
ColorChooser.add("Blue");
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12044044
:-D
0
 
LVL 35

Expert Comment

by:TimYates
ID: 12044047
/me points to his previous answer ;-)
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12044049
Remark:

addItem is obsolete as of Java 2 platform v1.1. Please use the add() method instead.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12044061
:°P  
hehehe ;°)
0
 

Author Comment

by:pkrush
ID: 12046069
Thank you both very much.
0
 

Author Comment

by:pkrush
ID: 12046259
If one was bent on using the GUI form designer (like me) they could just place the add statements to the post-init code as well. I just thought there would be a better way.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12051715
Thanks
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question