jQuery in Action, 3rd edition
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "jComboBox " Watch "jComboBox " New topic


Larrydean king

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

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:

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
I agree. Here's the link: http://aspose.com/file-tools
subject: jComboBox
It's not a secret anymore!