aspose file tools*
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
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: 38334
    
  23
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic JList generation in Swing