This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to listen multiple JList?

 
samifox
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Coders
Im developing a Swing GUI and I use a several JList in it. my class implements ListSelectionListener and in order Im overriding valueChanged().
I�ve no problems to detect one Jlist adjusting event but when its becomes to more then one JList the method valueChanged() effect to two Jlist ,
How can I listen to multiple Jlist in the same valueChanged ?
Thanks in advance
Shay
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Samifox,
Just add the same class as the listener for each JList. Inside the valueChanged method just use the given object handle. The following code should work.

Enjoy,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic