It's not a secret anymore!
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 Java Interview Guide this week in the Jobs Discussion 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
I agree. Here's the link:
subject: Create costume interface
It's not a secret anymore!