This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Dynamic JList generation in Swing  Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

Dynamic JList generation in Swing

ishan dave
Ranch Hand

Joined: Apr 16, 2007
Posts: 39
hi friends

I have a JCombobox having 3 items and a JList. Now suppose some one selects the first item from the combobox say Item1 then according to that item the contents of list should be displayed and if he selects Item2 then according to that item the contents of list would be changed dynamically.
so anyone please help me to solve my this problame i also paste the code which i thought to solve the above problame but i can't work.


ishan
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38040
    
  22
Please don't post the same question twice.
Andrei Pat
Greenhorn

Joined: Apr 19, 2007
Posts: 13
add an action listener to the JComboBox, in that listener you update the JList according to the selected item from the JComboBox. You have to do somethig like:
ishan dave
Ranch Hand

Joined: Apr 16, 2007
Posts: 39
Dear Andrei Pat,

Thanks a lot for your guidence. My problame solved with your help. Thanks Andrei

Ishan
 
Don't get me started about those stupid light bulbs.
 
subject: Dynamic JList generation in Swing
 
Similar Threads
GridBagLayout resize issue
problem selecting JList item
Dynamic Field in Swing
Reading from ListBox.
Recursive program help