Custom ActionListener

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

Custom ActionListener

Postby astuckey » Tue Jul 14, 2009 6:18 am

Hi,

Is there a way to add an external ActionListener class rather than having to use the SwingAction / AbstractAction.
If you right-click on the component, select "Add event handler" -> "action" -> "actionPerformed", an inner class implementing the ActionListener interface is created, and added to the component via "addActionListener". Is there a way to use an external class that implements the ActionListener interface via the Design, or does this have to be added manually via the Source tab? i.e. Can I add a ActionListener subclass to the Palette?

Thanks,
Adam
astuckey
 
Posts: 6
Joined: Mon Jul 13, 2009 4:50 am

Re: Custom ActionListener

Postby Eric Clayberg » Fri Jul 17, 2009 2:56 pm

Event handlers may be generated in a variety of ways. See the docs...

http://download.instantiations.com/D2WB ... dlers.html

There is no option to use an external ActionListener subclass.

The only other option is to create new SwingActions or select existing external SwingActions and drop them directly on the component.
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