This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes jComboBox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jComboBox " Watch "jComboBox " New topic
Author

jComboBox

Larrydean king
Greenhorn

Joined: Feb 25, 2004
Posts: 1
An applet with 3 combo boxes. You make a selction in the first combobox, and based on that selection, the options are in the second combobox, then based on the second selection, the options for the third combobox appear. How do I get that started? Picture Ordering CDs'; the first box is the music type,(country, jazz, etc...), the second box is Artists for that selection, (Garth Brooks, Toby Keith...), and the third is albums, (Ropin' The Wind, Greatists Hits, etc...)I want the Country artists for the country selection, Jazz artists for Jazz selection and so on. Using NetBeans IDE 3.5.1 form editor.
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

I don't think NetBeans Form Editor is going to help much, since this isn't really a layout issue, but an issue with the actual data behind the form. I'm also not sure how you're storing and accessing the data for this... it could be in a database, XML file, EJBs, etc. You also don't specify if you are using AWT or Swing for this, Swing would be easier, since it uses MVC and seperates the data a component holds from the visual representation of the component, but since you are using an Applet I'll assume AWT. Here's a quick example... it's not perfect in lots of ways... the data is hardcoded and stored in an internal hashtable for one, the user actually has to select a combobox before it's "child" combo is filled out, etc. but it should give you some idea of what to do:



-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
Don't get me started about those stupid light bulbs.
 
subject: jComboBox
 
Similar Threads
Jsp
Dynamic selection problem
control one JComboBox from another
conditionally generated optionsCollection?
Dropdown box value reset upon partial submit