Adding custom listener

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Adding custom listener

Postby Shlomi » Thu Mar 02, 2006 7:06 am

Hi,
In our program we had to create a customized ActionListener.
How do we define the Designer to use our listener when we want to add a new event handler (lets say, for a button).

Regards,
Shlomi
Shlomi
 
Posts: 14
Joined: Thu Mar 02, 2006 7:03 am

Re: Adding custom listener

Postby Eric Clayberg » Thu Mar 02, 2006 3:19 pm

Shlomi wrote:In our program we had to create a customized ActionListener. How do we define the Designer to use our listener when we want to add a new event handler (lets say, for a button).

You can't. Designer supports three styles of event code generation:

1) Create annonymous class
2) Create inner class
3) Implement listener interface in parent class[/url]

There is no option for accessing an arbitrary listener class. You would need to add that code to your class by hand.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest