SwingDesigner: Removing Actioninstances

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

SwingDesigner: Removing Actioninstances

Postby chrisR » Tue Jul 28, 2009 6:45 am

The category" Swing Actions" shows all Action Instances with a declaration within a class.
I want to remove an actioninstance. The instance is not added to a button.
From the palette I can choose the remove Item of the Popup, but this does not work.

How can I remove an actioninstance?
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: SwingDesigner: Removing Actioninstances

Postby Eric Clayberg » Tue Jul 28, 2009 6:49 am

chrisR wrote:I want to remove an actioninstance.

It isn't clear to me what you are asking for.

Remove an actioninstance from what?
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

Re: SwingDesigner: Removing Actioninstances

Postby chrisR » Tue Jul 28, 2009 7:04 am

Here a little example
I start with a JFrame, a Button and an Actioininstance
Code: Select all
public class TestFrame
   extends JFrame {
   private JButton btn;
   private final Action action = new SwingAction();
   public TestFrame() {
      initialize();
   }

I add a second action: action_1
Code: Select all
   private JButton btn;
   private final Action action = new SwingAction();
   private final Action action_1 = new SwingAction_1();

   protected JButton getBtn() {
      if (btn == null) {
         btn = new JButton("New button");
         btn.setAction(action_1);
      }
      return btn;
   }


SwingDesigner show the fields "action" and "action_1" in the component tree and the Category Swing Actions of the Palette.
How do I erase the field(Instance) "action" from the design page?

Kind regards
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: SwingDesigner: Removing Actioninstances

Postby Eric Clayberg » Sun Aug 02, 2009 6:11 pm

Using the latest Swing Designer v7.1 build, you should be able to right-click on them in the component tree and delete them.
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

Re: SwingDesigner: Removing Actioninstances

Postby chrisR » Wed Aug 05, 2009 12:07 am

Thanks,

it works :)
good job.

Thanks
Chris
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: SwingDesigner: Removing Actioninstances

Postby Eric Clayberg » Wed Aug 05, 2009 4:42 am

Glad that worked for you.
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