This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to listen multiple JList? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to listen multiple JList?" Watch "How to listen multiple JList?" New topic

How to listen multiple JList?


Joined: Sep 03, 2001
Posts: 5
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
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
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.

I agree. Here's the link:
subject: How to listen multiple JList?
It's not a secret anymore!