Example usage for com.jgoodies.forms.layout CellConstraints xywh

List of usage examples for com.jgoodies.forms.layout CellConstraints xywh

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints xywh.

Prototype

public CellConstraints xywh(int col, int row, int colSpan, int rowSpan) 

Source Link

Document

Sets the column, row, width, and height; uses default alignments.

Examples:

 cc.xywh(1, 3, 2, 1); cc.xywh(1, 3, 7, 3); 

Usage

From source file:com.zeroc.IceGridGUI.LiveDeployment.DbEnvEditor.java

License:Open Source License

@Override
protected void appendProperties(DefaultFormBuilder builder) {
    builder.append("Description");
    builder.nextLine();/*from   w ww . ja  v  a 2  s  .co m*/
    builder.append("");
    builder.nextRow(-2);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_description);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 3));
    builder.nextRow(2);
    builder.nextLine();

    builder.append("DB Home");
    builder.append(_dbHome, 3);
    builder.nextLine();

    builder.append("Properties");
    builder.nextLine();

    builder.append("");
    builder.nextLine();

    builder.append("");
    builder.nextLine();

    builder.append("");
    builder.nextRow(-6);
    scrollPane = new JScrollPane(_properties);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.LogFilterDialog.java

License:Open Source License

LogFilterDialog(final ShowIceLogDialog dialog) {
    super(dialog, "Ice log filter - IceGrid Admin", true);
    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

    java.util.Set<com.zeroc.Ice.LogMessageType> messageTypeFilterSet = null;
    if (dialog.getMessageTypeFilter() != null) {
        messageTypeFilterSet = new java.util.HashSet<>(java.util.Arrays.asList(dialog.getMessageTypeFilter()));
    }/*from w w  w  .  j a  v a 2 s  . c  o  m*/

    final JCheckBox error = new JCheckBox("Error",
            messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.ErrorMessage));
    final JCheckBox warning = new JCheckBox("Warning",
            messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.WarningMessage));
    final JCheckBox print = new JCheckBox("Print",
            messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.PrintMessage));
    final JCheckBox trace = new JCheckBox("Trace",
            messageTypeFilterSet == null || messageTypeFilterSet.contains(LogMessageType.TraceMessage));

    final JTextArea traceCategories = new JTextArea(3, 40);
    traceCategories.setLineWrap(true);

    String[] traceCategoryFilter = dialog.getTraceCategoryFilter();
    if (traceCategoryFilter != null) {
        // TODO: join with escapes!
        traceCategories.setText(com.zeroc.IceUtilInternal.StringUtil
                .joinString(java.util.Arrays.asList(traceCategoryFilter), ", "));
    } else {
        traceCategories.setText(null);
    }

    traceCategories.setToolTipText("Trace categories separated by commas; leave blank to get all categories");

    JButton okButton = new JButton("OK");
    ActionListener okListener = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            String[] traceCategoryFilter = null;

            String txt = traceCategories.getText();
            if (txt != null && !txt.isEmpty()) {
                traceCategoryFilter = com.zeroc.IceUtilInternal.StringUtil.splitString(txt, ", \t\r\n");
                if (traceCategoryFilter == null) {
                    // unmatched quote
                    JOptionPane.showMessageDialog(LogFilterDialog.this,
                            "Unmatched quote in Trace categories field", "Invalid entry",
                            JOptionPane.ERROR_MESSAGE);
                    return;
                }

                if (traceCategoryFilter.length == 0) // only separators
                {
                    traceCategoryFilter = null;
                }
            }

            java.util.Set<LogMessageType> messageTypeFilterSet = new java.util.HashSet<>();
            if (error.isSelected()) {
                messageTypeFilterSet.add(LogMessageType.ErrorMessage);
            }
            if (warning.isSelected()) {
                messageTypeFilterSet.add(LogMessageType.WarningMessage);
            }
            if (print.isSelected()) {
                messageTypeFilterSet.add(LogMessageType.PrintMessage);
            }
            if (trace.isSelected()) {
                messageTypeFilterSet.add(LogMessageType.TraceMessage);
            }
            if (messageTypeFilterSet.size() == 0 || messageTypeFilterSet.size() == 4) {
                // All or nothing checked equivalent of getting everything!
                messageTypeFilterSet = null;
            }
            LogMessageType[] messageTypeFilter = null;
            if (messageTypeFilterSet != null) {
                messageTypeFilter = messageTypeFilterSet.toArray(new LogMessageType[0]);
            }

            dispose();
            dialog.setFilters(messageTypeFilter, traceCategoryFilter);
        }
    };
    okButton.addActionListener(okListener);
    getRootPane().setDefaultButton(okButton);

    JButton cancelButton = new JButton("Cancel");
    ActionListener cancelListener = new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            dispose();
        }
    };
    cancelButton.addActionListener(cancelListener);

    FormLayout layout = new FormLayout("left:pref, 3dlu, fill:pref:grow", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.rowGroupingEnabled(true);
    builder.lineGapSize(LayoutStyle.getCurrent().getLinePad());

    builder.appendSeparator("Retrieve only the following types of log messages (server-side filtering)");
    builder.nextLine();
    builder.append(error);
    builder.nextLine();
    builder.append(warning);
    builder.nextLine();
    builder.append(print);
    builder.nextLine();
    builder.append(trace);
    builder.nextLine();
    builder.append("Trace categories");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-2);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(traceCategories);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 1, 3));
    builder.nextRow(2);
    builder.nextLine();

    JComponent buttonBar = new ButtonBarBuilder().addGlue().addButton(okButton, cancelButton).build();
    buttonBar.setBorder(Borders.DIALOG);

    java.awt.Container contentPane = getContentPane();
    contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
    contentPane.add(builder.getPanel());
    contentPane.add(buttonBar);

    pack();
    setResizable(false);
    setLocationRelativeTo(dialog);
    setVisible(true);
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.NodeEditor.java

License:Open Source License

@Override
protected void appendProperties(DefaultFormBuilder builder) {
    builder.appendSeparator("System Information");

    builder.append("Hostname");
    builder.append(_hostname, 3);/*from   w ww.  ja v a 2  s  . c  o m*/
    builder.nextLine();
    builder.append("Operating System");
    builder.append(_os, 3);

    builder.nextLine();
    builder.append("Machine Type");
    builder.append(_machineType, 3);
    builder.append(_loadAverageLabel, _loadAverage);
    builder.append(_refreshButton);
    builder.nextLine();

    builder.appendSeparator("Configuration");

    builder.append("Load Factor");
    builder.nextLine();

    builder.append("");
    builder.nextLine();

    builder.append("");
    builder.nextLine();

    builder.append("");
    builder.nextRow(-6);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_loadFactor);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.ObjectDialog.java

License:Open Source License

ObjectDialog(final Root root, boolean readOnly) {
    super(root.getCoordinator().getMainFrame(),
            (readOnly ? "" : "New ") + "Dynamic Well-Known Object - IceGrid Admin", true);

    setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
    _mainFrame = root.getCoordinator().getMainFrame();

    _proxy.setLineWrap(true);// ww w . j a va  2 s.c  o  m

    if (readOnly) {
        _proxy.setEditable(false);
        _proxy.setOpaque(false);
        _type.setEditable(false);
    } else {
        _typeCombo.setEditable(true);
    }

    FormLayout layout = new FormLayout("right:pref, 3dlu, pref", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);
    builder.border(Borders.DIALOG);
    builder.rowGroupingEnabled(true);
    builder.lineGapSize(LayoutStyle.getCurrent().getLinePad());

    builder.append("Proxy");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-2);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_proxy);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 1, 3));
    builder.nextRow(2);
    builder.nextLine();

    if (readOnly) {
        builder.append("Type", _type);
    } else {
        builder.append("Type", _typeCombo);
    }
    builder.nextLine();

    Container contentPane = getContentPane();
    if (readOnly) {
        contentPane.add(builder.getPanel());
    } else {
        JButton okButton = new JButton("OK");
        ActionListener okListener = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (_proxy.isEditable()) {
                    String type = null;
                    if (_typeCombo.getSelectedItem() != QUERY_OBJECT) {
                        type = _typeCombo.getSelectedItem().toString();
                    }

                    root.addObject(_proxy.getText(), type, ObjectDialog.this);
                } else {
                    setVisible(false);
                }
            }
        };
        okButton.addActionListener(okListener);
        getRootPane().setDefaultButton(okButton);

        JButton cancelButton = new JButton("Cancel");
        ActionListener cancelListener = new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                setVisible(false);
            }
        };
        cancelButton.addActionListener(cancelListener);

        JComponent buttonBar = new ButtonBarBuilder().addGlue().addButton(okButton, cancelButton).build();
        buttonBar.setBorder(Borders.DIALOG);

        contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
        contentPane.add(builder.getPanel());
        contentPane.add(buttonBar);
    }

    pack();
    setResizable(false);
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.RegistryEditor.java

License:Open Source License

@Override
protected void appendProperties(DefaultFormBuilder builder) {
    CellConstraints cc = new CellConstraints();

    builder.append("Hostname");
    builder.append(_hostname, 3);//from w  w  w  .  ja v a 2 s .com
    builder.nextLine();

    builder.appendSeparator("Deployed Applications");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    JScrollPane scrollPane = new JScrollPane(_applications);
    scrollPane.setToolTipText(_applications.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();

    builder.appendSeparator("Dynamic Well-Known Objects");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    scrollPane = new JScrollPane(_objects);
    scrollPane.setToolTipText(_objects.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();

    builder.appendSeparator("Dynamic Object Adapters");
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-14);
    scrollPane = new JScrollPane(_adapters);
    scrollPane.setToolTipText(_adapters.getToolTipText());
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 14));
    builder.nextRow(14);
    builder.nextLine();
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.ServerEditor.java

License:Open Source License

@Override
protected void appendProperties(DefaultFormBuilder builder) {
    builder.appendSeparator("Runtime Status");

    builder.append("State");
    builder.append(_currentState, 3);/* w  w  w. j  a v  a2 s. c  o  m*/
    builder.nextLine();

    builder.append("", _enabled);
    builder.nextLine();

    builder.append("Process Id");
    builder.append(_currentPid, 3);
    builder.nextLine();

    builder.append("Build Id");
    builder.append(_buildId, _refreshButton);
    builder.nextLine();

    builder.append("Properties");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");

    builder.nextLine();
    builder.append("");

    builder.nextRow(-6);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_properties);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();

    builder.appendSeparator("Configuration");

    builder.append("Application");
    builder.append(_application);
    builder.append(_gotoApplication);
    builder.nextLine();

    //
    // Add Communicator fields
    //
    super.appendProperties(builder);

    builder.appendSeparator("Activation");
    builder.append("Path to Executable");
    builder.append(_exe, 3);
    builder.nextLine();
    builder.append("Ice Version");
    builder.append(_iceVersion, 3);
    builder.nextLine();
    builder.append("Working Directory");
    builder.append(_pwd, 3);
    builder.nextLine();
    builder.append("Command Arguments");
    builder.append(_options, 3);
    builder.nextLine();
    builder.append("Run as");
    builder.append(_user, 3);
    builder.nextLine();
    builder.append("Environment Variables");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");
    builder.nextRow(-6);
    scrollPane = new JScrollPane(_envs);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();

    builder.append("Activation Mode");
    builder.append(_activation, 3);
    builder.nextLine();
    builder.append("Activation Timeout");
    builder.append(_activationTimeout, 3);
    builder.nextLine();
    builder.append("Deactivation Timeout");
    builder.append(_deactivationTimeout, 3);
    builder.nextLine();
    builder.append("", _allocatable);
    builder.nextLine();

    JComponent c = builder.appendSeparator("Distribution");
    c.setToolTipText("Files specific to this server");

    builder.append("", _applicationDistrib);
    builder.nextLine();
    builder.append("IcePatch2 Proxy");
    builder.append(_icepatch, 3);
    builder.nextLine();
    builder.append("Directories");
    builder.append(_directories, 3);
    builder.nextLine();
}

From source file:com.zeroc.IceGridGUI.LiveDeployment.ServiceEditor.java

License:Open Source License

@Override
protected void appendProperties(DefaultFormBuilder builder) {
    builder.appendSeparator("Runtime Status");

    builder.append("", _started);
    builder.nextLine();//w  ww .ja va  2  s .c  o  m

    builder.append("Build Id");
    builder.append(_buildId, _refreshButton);
    builder.nextLine();

    builder.append("Properties");
    builder.nextLine();
    builder.append("");
    builder.nextLine();
    builder.append("");

    builder.nextLine();
    builder.append("");

    builder.nextRow(-6);
    CellConstraints cc = new CellConstraints();
    JScrollPane scrollPane = new JScrollPane(_properties);
    builder.add(scrollPane, cc.xywh(builder.getColumn(), builder.getRow(), 3, 7));
    builder.nextRow(6);
    builder.nextLine();

    builder.appendSeparator("Configuration");

    super.appendProperties(builder);

    builder.append("Entry Point");
    builder.append(_entry, 3);
    builder.nextLine();
}

From source file:core.reporting.ExportParameters.java

License:Open Source License

/**
 * Create and return all panels assembled in one
 * /*from w w  w .j a va2s.c  om*/
 * @return JPanel
 */
private JPanel getAssembledComponents() {
    FormLayout lay = new FormLayout("fill:pref, 7dlu, fill:130dlu", // columns
            "pref, 7dlu, pref, 7dlu, pref"); // rows
    CellConstraints cc = new CellConstraints();
    PanelBuilder build = new PanelBuilder(lay);

    build.add(getGeneralOptionsPanel(), cc.xy(1, 1));
    build.add(getOutputOptionsPanel(), cc.xy(1, 3));
    build.add(getFieldsSelectionPanel(), cc.xywh(3, 1, 1, 3));
    if (supplier instanceof AmountViewer) {
        build.add(getNodePatternEditorPanel(), cc.xyw(1, 5, 3));
    }
    JPanel jp = build.getPanel();
    return jp;
}

From source file:cz.cuni.mff.peckam.java.origamist.gui.editor.OrigamiPropertiesFrame.java

License:Open Source License

/**
 * Add all components to a layout./*from  w ww. j  a  v a 2 s . c  o m*/
 */
protected void buildLayout() {
    Configuration conf = ServiceLocator.get(ConfigurationManager.class).get();

    CellConstraints cc = new CellConstraints();

    final JTabbedPane tabPane = new JTabbedPane();
    int tabIndex = 0;

    JPanel basicPanel = new JPanel(new FormLayout("$dmargin,right:pref,$lcgap,pref:grow,$dmargin",
            "$dmargin,pref,$lgap,pref,$lgap,pref,$lgap,pref,$lgap,pref,$lgap,pref,$lgap,pref,$dmargin"));
    final int basicPanelTabIndex = tabIndex++;
    tabPane.addTab("", basicPanel);
    conf.addAndRunResourceBundleListener(
            new Configuration.LocaleListener("application", "OrigamiPropertiesFrame.basicPanelTitle") {
                @Override
                protected void updateText(String text) {
                    tabPane.setTitleAt(basicPanelTabIndex, text);
                }
            });

    basicPanel.add(nameLabel, cc.xy(2, 2));
    basicPanel.add(name, cc.xy(4, 2));
    basicPanel.add(creationDateLabel, cc.xy(2, 4));
    basicPanel.add(creationDate, cc.xy(4, 4));
    basicPanel.add(authorNameLabel, cc.xy(2, 6));
    basicPanel.add(authorName, cc.xy(4, 6));
    basicPanel.add(authorHomepageLabel, cc.xy(2, 8));
    basicPanel.add(authorHomepage, cc.xy(4, 8));
    basicPanel.add(shortDescLabel, cc.xy(2, 10));
    basicPanel.add(shortDesc, cc.xy(4, 10));
    basicPanel.add(originalLabel, cc.xy(2, 12));
    basicPanel.add(original, cc.xy(4, 12));
    basicPanel.add(description, cc.xywh(2, 14, 3, 1));

    JPanel thumbnailPanel = new JPanel(
            new FormLayout("$dmargin,center:min(pref;50dlu),$ugap,pref,$ugap,pref,$dmargin",
                    "$dmargin,pref,$lgap,pref,$dmargin"));
    final int thumbnailPanelTabIndex = tabIndex++;
    tabPane.addTab("", thumbnailPanel);
    conf.addAndRunResourceBundleListener(
            new Configuration.LocaleListener("application", "OrigamiPropertiesFrame.thumbnailPanelTitle") {
                @Override
                protected void updateText(String text) {
                    tabPane.setTitleAt(thumbnailPanelTabIndex, text);
                }
            });

    thumbnailPanel.add(thumbnailPreviewLabel, cc.xy(2, 2));
    thumbnailPanel.add(thumbnailPreview, cc.xy(2, 4));
    thumbnailPanel.add(thumbnailLoadFromModel, cc.xy(4, 2));
    thumbnailPanel.add(thumbnailLoadFromFile, cc.xy(6, 2));
    thumbnailPanel.add(thumbnailFileInputLabel, cc.xy(4, 4));
    thumbnailPanel.add(thumbnailFileInput, cc.xy(6, 4));

    final JScrollPane licenseContentScrollPane = new JScrollPane(licenseContent,
            JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);

    JPanel licenseNamePanel = new JPanel(new FormLayout("pref,$lcgap,pref:grow", "pref"));
    licenseNamePanel.add(licenseNameLabel, cc.xy(1, 1));
    licenseNamePanel.add(licenseName, cc.xy(3, 1));

    licenseChooseContent.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                licenseHomepageLabel.setVisible(false);
                licenseContentLabel.setVisible(true);
                licenseContentScrollPane.setVisible(true);
            }
        }
    });
    licenseChooseHomepage.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                licenseContentLabel.setVisible(false);
                licenseHomepageLabel.setVisible(true);
                licenseContentScrollPane.setVisible(false);
            }
        }
    });
    licenseHomepageLabel.setVisible(licenseHomepage.isVisible());
    licenseContentLabel.setVisible(licenseContent.isVisible());
    licenseContentScrollPane.setVisible(licenseContent.isVisible());

    JPanel licenseContentPanel = new JPanel(new FlowLayout(FlowLayout.LEADING));
    licenseContentPanel.add(licenseChooseContent);
    licenseContentPanel.add(licenseChooseHomepage);

    JPanel licenseHomepagePanel = new JPanel(new FormLayout("pref,$lcgap,pref:grow", "pref"));
    licenseHomepagePanel.add(licenseHomepageLabel, cc.xy(1, 1));
    licenseHomepagePanel.add(licenseHomepage, cc.xy(3, 1));

    JPanel licensePermissionPanel = new JPanel(new GridLayout(0, 1));
    licensePermissionPanel.add(licensePermissionDoNothing);
    licensePermissionPanel.add(licensePermissionEdit);
    licensePermissionPanel.add(licensePermissionExport);
    licensePermissionPanel.add(licensePermissionDistribute);

    JPanel licensePanel = new JPanel(new FormLayout("$dmargin,min(pref;500px):grow,$dmargin",
            "$dmargin,pref,$lgap,pref,$lgap,pref,$rgap,pref,$lgap,pref,$lgap,pref,$lgap,pref,$lgap,pref,$dmargin"));
    final int licensePanelTabIndex = tabIndex++;
    tabPane.addTab("", licensePanel);
    conf.addAndRunResourceBundleListener(
            new Configuration.LocaleListener("application", "OrigamiPropertiesFrame.licensePanelTitle") {
                @Override
                protected void updateText(String text) {
                    tabPane.setTitleAt(licensePanelTabIndex, text);
                }
            });

    JPanel predefinedLicensesPanel = new JPanel(new FormLayout("pref"));
    PanelBuilder builder = new PanelBuilder((FormLayout) predefinedLicensesPanel.getLayout(),
            predefinedLicensesPanel);
    for (JRadioButton b : predefinedLicenses) {
        builder.appendRow("$lgap");
        builder.appendRow("pref");
        builder.nextLine();
        builder.add(b);
        builder.nextLine();
    }

    JLabel licenseChooseLabel = new JLocalizedLabel("application", "OrigamiPropertiesFrame.licenseChooseLabel");

    licensePanel.add(licenseNamePanel, cc.xy(2, 2));
    licensePanel.add(predefinedLicensesPanel, cc.xy(2, 4));
    licensePanel.add(licenseChooseLabel, cc.xy(2, 6));
    licensePanel.add(licenseContentPanel, cc.xy(2, 8));
    licensePanel.add(licenseContentLabel, cc.xy(2, 10));
    licensePanel.add(licenseContentScrollPane, cc.xy(2, 12));
    licensePanel.add(licenseHomepagePanel, cc.xy(2, 14));
    licensePanel.add(licensePermissionPanel, cc.xy(2, 16));

    final int diagramPaperTabIndex = tabIndex++;
    JPanel diagramPaperPanel = new JPanel(
            new FormLayout("$dmargin,default,$dmargin", "$dmargin,default,$dmargin"));
    diagramPaperPanel.add(diagramPaper, cc.xy(2, 2));
    tabPane.addTab("", diagramPaperPanel);
    conf.addAndRunResourceBundleListener(
            new Configuration.LocaleListener("application", "OrigamiPropertiesFrame.diagramPaperLabel") {
                @Override
                protected void updateText(String text) {
                    tabPane.setTitleAt(diagramPaperTabIndex, text);
                }
            });

    final int modelPaperTabIndex = tabIndex++;
    JPanel modelPaperPanel = new JPanel(
            new FormLayout("$dmargin,default,$dmargin", "$dmargin,default,$dmargin"));
    modelPaperPanel.add(modelPaper, cc.xy(2, 2));
    tabPane.addTab("", modelPaperPanel);
    conf.addAndRunResourceBundleListener(
            new Configuration.LocaleListener("application", "OrigamiPropertiesFrame.modelPaperLabel") {
                @Override
                protected void updateText(String text) {
                    tabPane.setTitleAt(modelPaperTabIndex, text);
                }
            });

    JPanel dialogButtonsPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING));
    dialogButtonsPanel.add(cancelButton);
    dialogButtonsPanel.add(okButton);

    setLayout(new FormLayout("default", "default,$lgap,default"));
    add(tabPane, cc.xy(1, 1));
    add(dialogButtonsPanel, cc.xy(1, 3));

    pack();
}

From source file:cz.vity.freerapid.gui.dialogs.NewLinksDialog.java

@SuppressWarnings({ "deprecation" })
private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Open Source Project license - unknown
    //ResourceBundle bundle = ResourceBundle.getBundle("NewLinksDialog");
    JPanel dialogPane = new JPanel();
    JPanel contentPanel = new JPanel();
    JLabel labelLinks = new JLabel();
    JScrollPane scrollPane1 = new JScrollPane();
    urlsArea = ComponentFactory.getURLsEditorPane();
    JLabel labelSaveTo = new JLabel();
    comboPath = new JComboBox();
    btnSelectPath = new JButton();
    JLabel labelDescription = new JLabel();
    JScrollPane scrollPane2 = new JScrollPane();
    descriptionArea = ComponentFactory.getTextArea();
    JXButtonPanel buttonBar = new JXButtonPanel();
    btnPasteFromClipboard = new JButton();
    okButton = new JButton();
    btnStartPaused = new JButton();
    cancelButton = new JButton();
    CellConstraints cc = new CellConstraints();

    //======== this ========
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {//w ww.  ja  va 2s.  c o  m
        dialogPane.setBorder(Borders.DIALOG);
        dialogPane.setLayout(new BorderLayout());

        //======== contentPanel ========
        {

            //---- labelLinks ----
            labelLinks.setName("labelLinks");
            labelLinks.setLabelFor(urlsArea);

            //======== scrollPane1 ========
            {
                scrollPane1.setViewportView(urlsArea);
            }

            //---- labelSaveTo ----
            labelSaveTo.setName("labelSaveTo");
            labelSaveTo.setLabelFor(comboPath);

            //---- comboPath ----
            comboPath.setEditable(true);

            //---- btnSelectPath ----
            btnSelectPath.setName("btnSelectPath");

            //---- labelDescription ----
            labelDescription.setName("labelDescription");
            labelDescription.setLabelFor(descriptionArea);

            //======== scrollPane2 ========
            {
                scrollPane2.setViewportView(descriptionArea);
            }

            PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.MIN_COLSPEC },
                    new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW),
                            FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC,
                            new RowSpec(RowSpec.FILL,
                                    Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(55)),
                                    FormSpec.DEFAULT_GROW) }),
                    contentPanel);

            contentPanelBuilder.add(labelLinks, cc.xy(1, 1));
            contentPanelBuilder.add(scrollPane1, cc.xywh(1, 3, 5, 1));
            contentPanelBuilder.add(labelSaveTo, cc.xy(1, 5));
            contentPanelBuilder.add(comboPath, cc.xy(3, 5));
            contentPanelBuilder.add(btnSelectPath, cc.xy(5, 5));
            contentPanelBuilder.add(labelDescription, cc.xy(1, 7));
            contentPanelBuilder.add(scrollPane2, cc.xywh(3, 7, 3, 1));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));

            //---- btnPasteFromClipboard ----
            btnPasteFromClipboard.setName("btnPasteFromClipboard");

            //---- okButton ----
            okButton.setName("okButton");

            //---- btnStartPaused ----
            btnStartPaused.setName("btnStartPaused");

            //---- cancelButton ----
            cancelButton.setName("cancelButton");

            PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout(
                    new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                            new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW),
                            FormSpecs.UNRELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC,
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(pref;50dlu)"),
                            FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(pref;50dlu)"), },
                    RowSpec.decodeSpecs("fill:pref")), buttonBar);
            ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 5, 9 } });

            buttonBarBuilder.add(btnPasteFromClipboard, cc.xy(1, 1));
            buttonBarBuilder.add(okButton, cc.xy(5, 1));
            buttonBarBuilder.add(btnStartPaused, cc.xy(7, 1));
            buttonBarBuilder.add(cancelButton, cc.xy(9, 1));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
}