Results 1 to 3 of 3
Thread: Syntax for choice box(combo box)
- 08-14-2008, 07:20 PM #1
Member
- Join Date
- Aug 2008
- Posts
- 5
- Rep Power
- 0
Syntax for choice box(combo box)
How do u declare and initialize choice boxes??
Is it like
String[] TypeItems = {"Regular", "Diet"};
Choice cboType = new Choice(TypeItems);
or
String[] TypeItems = {"Regular", "Diet"};
cboType = new Choice(TypeItems);
the latter gave a compiler error saying that <identifier> is expected
Thank You in advance
- 08-14-2008, 08:39 PM #2
Use a Search to find code samples.
If you get errors, copy and paste the full text of the message, don't edit it.
- 08-14-2008, 10:26 PM #3
This would work for okay a JComboBox. Choice is an AWT component. According to its api it has a single, no–argument constructor and an add(String item) method.Java Code:String[] TypeItems = {"Regular", "Diet"}; Choice cboType = new Choice(TypeItems);
Similar Threads
-
[SOLVED] Looking for web.xml syntax doc
By Norm in forum Java ServletReplies: 2Last Post: 08-21-2008, 07:59 PM -
Need help with T/F and Multiple Choice
By sayso36 in forum Advanced JavaReplies: 0Last Post: 03-12-2008, 04:39 PM -
Using java.awt.Choice
By Java Tip in forum Java TipReplies: 0Last Post: 01-02-2008, 06:33 PM -
syntax error
By gabriel in forum New To JavaReplies: 3Last Post: 08-03-2007, 03:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks