Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Dynamic JComboBox Help  RSS feed

 
Al Swensen
Greenhorn
Posts: 17
Firefox Browser jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm having some trouble trying to get my JComboBox working properly... Basically, I have a JMenuBar with several options, and depending on what the user chooses from that menu, a combo box will be populated with a different string of options. So for example, I have 2 JMenu items: "Cars" and "Animals." Clicking on the "Cars" option will populate a JComboBox with 3 options: "Chevy", "Ford", "Hyundai". Clicking on "Animals" will populate it with "Cat", "Dog", "Bird", "Fish".

How would that be done? I was looking for an example of using the ABstractListModel ant DefaultcomboBoxModel to do this but I couldn't find a whole lot on Google or on the Sun website and I'm not sure where to start. Any help would be great!
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
reply deleted

I just love wasting my time
http://forum.java.sun.com/thread.jspa?threadID=754443&tstart=0

won't happen again Al/mistah-java/whatever else

aren't ignore lists great
[ July 22, 2006: Message edited by: Michael Dunn ]
 
Al Swensen
Greenhorn
Posts: 17
Firefox Browser jQuery PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry... I posted there first, because I couldn't get to the Java Ranch site when I had this problem. Is there something wrong with getting mutiple opinions on a problem? Java Ranch is always my first choice for getting help with programming problems, as I've been helped several times here -- I just coudn't get to the site the other day. So sorry if I "wasted your time", that wasn't my intention at all. :/
 
fred rosenberger
lowercase baba
Bartender
Posts: 12443
42
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i believe the unofficial policy of the ranch is that we don't care if you post to other forums. We don't want you to post the same question more than once here, however (i.e don't post in "Java in General - Beginners" if you've already posted it in the SWING forum).
 
Jewel Bochs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[response deleted, please check your private messages - Ilja]
[ July 24, 2006: Message edited by: Ilja Preuss ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!