Remember variable name in component

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

Remember variable name in component

Postby chrisR » Wed Aug 12, 2009 7:18 am

If "Remember variable name in component" is activate (Eclipse Pref: WindowBuilder/Swing/Code Generation/Variables/Miscellaneous")
SwingDesigner sets the name of the variable (lbl) as the name
Code: Select all
   protected JLabel getLbl() {
      if (lbl == null) {
         lbl = new JLabel("New label");
         lbl.setName("lbl");
      }
      return lbl;
   }


When I change the text of the label. SwingDesigner corrects the name of the variable
but does not correct setName() but (see below)

Code: Select all
   protected JLabel getLblTest() {
      if (lblTest == null) {
         lblTest = new JLabel("test");
         lblTest.setName("lblTest");
         lblTest.setName("lbl");
      }
      return lblTest;
   }
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: Remember variable name in component

Postby Eric Clayberg » Fri Aug 14, 2009 5:31 am

Please give this a try using the latest Swing Designer v7.1 build.
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: Remember variable name in component

Postby chrisR » Sun Aug 16, 2009 8:52 pm

Thanks,
it works. :D
Kind regards
Chris
chrisR
 
Posts: 19
Joined: Thu Jul 23, 2009 5:07 am

Re: Remember variable name in component

Postby Eric Clayberg » Tue Aug 18, 2009 2:17 pm

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