File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Dynamic JList generation in Swing

 
ishan dave
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Pie
Posts: 47270
52
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't post the same question twice.
 
Andrei Pat
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
    Bookmark Topic Watch Topic
  • New Topic