It regards dynamic combo boxes( i think they are called dynamic because i googled it and thats how most people describe it), now I do have ComboBoxes covered in my book, but it doesn't cover what I need now. For my project I need to build 2 combo boxes. And I can select a value from the first combo box and that value will then directly effect the second combo box which will then contain values which are dependent on the value chosen in the first combo box. Now I can implement regular combo boxes in my program and make them work, but I just can not find a good and clear example of how the communication between them works, so if anyone could be kind enough to help me out here, I would appreciate it very much.

May 16th, 2011, 04:28 PM

copeg

Re: Dynamic JComboBoxes ?

It depends upon your datamodel, but you can monitor the selected choice of the first with an ActionListener, upon which you remove all items of the second and then populate it with the appropriate information.

May 16th, 2011, 04:34 PM

shad3d

Re: Dynamic JComboBoxes ?

Okay I understand that but, i am a beginner in Java especially GUI, so if you could provide a example that a beginner could understand I would be thankful. And my knowledge of ActionListeners is now really vague, I think this is a too big of a bite for me now, but I would really like if I could get a hang of this. Thank you for the reply, i will try googleing some more.