JGoodies PanelBuilder

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

JGoodies PanelBuilder

Postby michaelm » Fri Apr 16, 2010 3:53 am

Hello,

last week I have started using Swing Designer and so far I am quite satisfied. To evaluate the Swing Designer I have tried to open Swing GUIs currently in use in my company which works fine in most cases. Some applications use the JGoodies PanelBuilder to create panels with FormLayout (DefaultFormBuilder). Unfortunately Swing Designer seems to have problems dealing with JPanel objects created by DefaultFormBuilder or other builders like ButtonBarBuilder.

When I work with a JPanel as root container and would like to use panels created by PanelBuilder Swing Designer either does not show them in the preview at all or the preview is not correct. But if I use this root JPanel as a custom component and add it to a JFrame then the preview works just fine. Am I doing something wrong or is it a bug in the Swing Designer?

I am using JGoodies forms 1.2.0

Here is an example of such JPanel:
Code: Select all
public PanelBuilderTest()
   {

      initGUI();
   }

   private void initGUI()
   {
      setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
         FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
         FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,
         FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC,
         FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] {
         FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC,
         FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
         FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC,
         FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,
         FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), }));

      add(this.buildCenterPanel(), "14, 14, fill, fill");
   }

   private JPanel buildCenterPanel()
   {
      DefaultFormBuilder builder = new DefaultFormBuilder(new FormLayout("5dlu, pref, 7dlu, pref, 5dlu:grow", ""));
      // builder.setRowGroupingEnabled(true);
      builder.setLeadingColumnOffset(1);

      builder.appendSeparator("Sep");

      JLabel label = new JLabel("lbl");
      builder.append(label);

      JTextField text = new JTextField();
      text.setName("name");
      text.setHorizontalAlignment(SwingConstants.RIGHT);

      builder.append(text);
      builder.nextLine();

      return builder.getPanel();
   }
michaelm
 
Posts: 2
Joined: Fri Apr 16, 2010 3:31 am

Re: JGoodies PanelBuilder

Postby Eric Clayberg » Fri Apr 16, 2010 10:05 am

Swing Designer does not support JGoodies PanelBuilders.
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: JGoodies PanelBuilder

Postby michaelm » Sun Apr 18, 2010 10:24 pm

Hello,

thanks for the quick reply.

Are there any plans to support PanelBuilders in future?
michaelm
 
Posts: 2
Joined: Fri Apr 16, 2010 3:31 am

Re: JGoodies PanelBuilder

Postby Eric Clayberg » Mon Apr 19, 2010 3:55 am

michaelm wrote:Are there any plans to support PanelBuilders in future?

Not at this time. They seem to be very rarely used in the Swing world.
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