Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Swing / AWT / SWT and the fly likes Create costume interface 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
Bookmark "Create costume interface " Watch "Create costume interface " New topic

Create costume interface

Shay Gaghe
Ranch Hand

Joined: Sep 03, 2001
Posts: 102
Hello Coders
In my GUI I am using several components of the same type. Take multiple Jlist as an example, to be able capturing its both events I need to create two classes within my main class which implements the ListSelection interface each one.
I thought about easier way�if I can create interface like this:

Then by implementing the interface I can listen to each Jlist without the need of creating implementation classes and without conflicts and more logic.
But the problem is with the method: JLIst.addSelectionListener ()
What do I need to do to register my interface with the Jlist?
Thanks in advance
Shay Gaghe
subject: Create costume interface
Similar Threads
JList deleting multiple items
How to listen multiple JList?
Help me!!!
JList selection to int not working
Problem updating my JTable based on a JList selection and a DefaultTableModel