Example usage for java.awt GridBagConstraints NORTHWEST

List of usage examples for java.awt GridBagConstraints NORTHWEST

Introduction

In this page you can find the example usage for java.awt GridBagConstraints NORTHWEST.

Prototype

int NORTHWEST

To view the source code for java.awt GridBagConstraints NORTHWEST.

Click Source Link

Document

Put the component at the top-left corner of its display area.

Usage

From source file:org.executequery.gui.browser.ConnectionPanel.java

private void init() {

    // ---------------------------------
    // create the basic props panel

    // initialise the fields
    nameField = createTextField();//  w  ww . ja  va  2  s  . co  m
    passwordField = createPasswordField();
    hostField = createTextField();
    portField = createNumberTextField();
    sourceField = createMatchedWidthTextField();
    userField = createTextField();
    urlField = createMatchedWidthTextField();

    nameField.addFocusListener(new ConnectionNameFieldListener(this));

    savePwdCheck = ActionUtilities.createCheckBox("Store Password", "setStorePassword");
    encryptPwdCheck = ActionUtilities.createCheckBox("Encrypt Password", "setEncryptPassword");

    savePwdCheck.addActionListener(this);
    encryptPwdCheck.addActionListener(this);

    // retrieve the drivers
    buildDriversList();

    // ---------------------------------
    // add the basic connection fields

    TextFieldPanel mainPanel = new TextFieldPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    gbc.insets = new Insets(10, 10, 10, 10);
    gbc.gridy = 0;
    gbc.gridx = 0;

    statusLabel = new DefaultFieldLabel();
    addLabelFieldPair(mainPanel, "Status:", statusLabel, "Current connection status", gbc);

    gbc.insets.bottom = 5;
    addLabelFieldPair(mainPanel, "Connection Name:", nameField, "A friendly name for this connection", gbc);

    addLabelFieldPair(mainPanel, "User Name:", userField, "Login user name", gbc);

    addLabelFieldPair(mainPanel, "Password:", passwordField, "Login password", gbc);

    JButton showPassword = new LinkButton("Show Password");
    showPassword.setActionCommand("showPassword");
    showPassword.addActionListener(this);

    JPanel passwordOptionsPanel = new JPanel(new GridBagLayout());
    addComponents(passwordOptionsPanel,
            new ComponentToolTipPair[] {
                    new ComponentToolTipPair(savePwdCheck,
                            "Store the password with the connection information"),
                    new ComponentToolTipPair(encryptPwdCheck, "Encrypt the password when saving"),
                    new ComponentToolTipPair(showPassword, "Show the password in plain text") });

    gbc.gridy++;
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    mainPanel.add(passwordOptionsPanel, gbc);

    addLabelFieldPair(mainPanel, "Host Name:", hostField, "Server host name or IP address", gbc);

    addLabelFieldPair(mainPanel, "Port:", portField, "Database port number", gbc);

    addLabelFieldPair(mainPanel, "Data Source:", sourceField, "Data source name", gbc);

    addLabelFieldPair(mainPanel, "JDBC URL:", urlField, "The full JDBC URL for this connection (optional)",
            gbc);

    addDriverFields(mainPanel, gbc);

    connectButton = createButton("Connect", CONNECT_ACTION_COMMAND, 'T');
    disconnectButton = createButton("Disconnect", "disconnect", 'D');

    JPanel buttons = new JPanel(new GridBagLayout());
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.insets.top = 5;
    gbc.insets.left = 0;
    gbc.insets.right = 10;
    gbc.gridwidth = 1;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.anchor = GridBagConstraints.NORTHEAST;
    gbc.fill = GridBagConstraints.NONE;
    buttons.add(connectButton, gbc);
    gbc.gridx++;
    gbc.weightx = 0;
    buttons.add(disconnectButton, gbc);

    gbc.insets.right = 0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    mainPanel.add(buttons, gbc);

    // ---------------------------------
    // create the advanced panel

    model = new JdbcPropertiesTableModel();
    JTable table = new DefaultTable(model);
    table.getTableHeader().setReorderingAllowed(false);

    TableColumnModel tcm = table.getColumnModel();

    TableColumn column = tcm.getColumn(2);
    column.setCellRenderer(new DeleteButtonRenderer());
    column.setCellEditor(new DeleteButtonEditor(table, new JCheckBox()));
    column.setMaxWidth(24);
    column.setMinWidth(24);

    JScrollPane scroller = new JScrollPane(table);

    // advanced jdbc properties
    JPanel advPropsPanel = new JPanel(new GridBagLayout());
    advPropsPanel.setBorder(BorderFactory.createTitledBorder("JDBC Properties"));
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.insets.top = 0;
    gbc.insets.left = 10;
    gbc.insets.right = 10;
    gbc.weighty = 0;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    advPropsPanel.add(new DefaultFieldLabel("Enter any key/value pair properties for this connection"), gbc);
    gbc.gridy++;
    advPropsPanel.add(
            new DefaultFieldLabel("Refer to the relevant JDBC driver documentation for possible entries"), gbc);
    gbc.gridy++;
    gbc.insets.bottom = 10;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.BOTH;
    advPropsPanel.add(scroller, gbc);

    // transaction isolation
    txApplyButton = WidgetFactory.createInlineFieldButton("Apply", "transactionLevelChanged");
    txApplyButton.setToolTipText("Apply this level to all open connections of this type");
    txApplyButton.setEnabled(false);
    txApplyButton.addActionListener(this);

    // add a dummy select value to the tx levels
    String[] txLevels = new String[Constants.TRANSACTION_LEVELS.length + 1];
    txLevels[0] = "Database Default";
    for (int i = 1; i < txLevels.length; i++) {
        txLevels[i] = Constants.TRANSACTION_LEVELS[i - 1];
    }
    txCombo = WidgetFactory.createComboBox(txLevels);

    JPanel advTxPanel = new JPanel(new GridBagLayout());
    advTxPanel.setBorder(BorderFactory.createTitledBorder("Transaction Isolation"));
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.insets.top = 0;
    gbc.insets.left = 10;
    gbc.insets.right = 10;
    gbc.insets.bottom = 5;
    gbc.weighty = 0;
    gbc.weightx = 1.0;
    gbc.gridwidth = GridBagConstraints.REMAINDER;
    gbc.fill = GridBagConstraints.BOTH;
    gbc.anchor = GridBagConstraints.NORTHWEST;
    advTxPanel.add(new DefaultFieldLabel("Default transaction isolation level for this connection"), gbc);
    gbc.gridy++;
    gbc.insets.bottom = 10;
    advTxPanel.add(
            new DefaultFieldLabel(
                    "Note: the selected isolation level " + "will apply to ALL open connections of this type."),
            gbc);
    gbc.gridy++;
    gbc.gridx = 0;
    gbc.gridwidth = 1;
    gbc.insets.top = 0;
    gbc.insets.left = 10;
    gbc.weightx = 0;
    advTxPanel.add(new DefaultFieldLabel("Isolation Level:"), gbc);
    gbc.gridx = 1;
    gbc.insets.left = 5;
    gbc.weightx = 1.0;
    gbc.insets.right = 5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    advTxPanel.add(txCombo, gbc);
    gbc.gridx = 2;
    gbc.weightx = 0;
    gbc.insets.left = 0;
    gbc.insets.right = 10;
    advTxPanel.add(txApplyButton, gbc);

    JPanel advancedPanel = new JPanel(new BorderLayout());
    advancedPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    advancedPanel.add(advPropsPanel, BorderLayout.CENTER);
    advancedPanel.add(advTxPanel, BorderLayout.SOUTH);

    JScrollPane scrollPane = new JScrollPane(mainPanel);
    scrollPane.setBorder(null);

    sshTunnelConnectionPanel = new SSHTunnelConnectionPanel();

    tabPane = new JTabbedPane(JTabbedPane.BOTTOM);
    tabPane.addTab("Basic", scrollPane);
    tabPane.addTab("Advanced", advancedPanel);
    tabPane.addTab("SSH Tunnel", sshTunnelConnectionPanel);

    tabPane.addChangeListener(this);

    add(tabPane, BorderLayout.CENTER);

    EventMediator.registerListener(this);
}

From source file:ro.nextreports.designer.wizpublish.PublishFileWizardPanel.java

private void init() {

    setLayout(new GridBagLayout());

    nameTextField = new JTextField();
    pathTextField = new JTextField();
    pathTextField.setEditable(false);/*  w w w . j a v a  2s . co  m*/
    pathTextField.setBackground(Color.WHITE);
    dataSourceTextField = new JTextField();
    dataSourceTextField.setEditable(false);
    dataSourceTextField.setBackground(Color.WHITE);
    descriptionArea = new JTextArea(5, 20);
    scrArea = new JScrollPane(descriptionArea);
    selectDataSourceButton = new JButton(ImageUtil.getImageIcon("database"));
    selectDataSourceButton.setPreferredSize(buttonDim);
    selectDataSourceButton.setMaximumSize(buttonDim);
    selectDataSourceButton.setMinimumSize(buttonDim);
    selectDataSourceButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            createSelectionDialog(DBObject.DATABASE);
        }
    });

    JButton selectPathButton = new JButton(ImageUtil.getImageIcon("folder"));
    selectPathButton.setPreferredSize(buttonDim);
    selectPathButton.setMaximumSize(buttonDim);
    selectPathButton.setMinimumSize(buttonDim);
    selectPathButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            String entity = (String) context.getAttribute(WizardConstants.ENTITY);
            byte type;
            if (WizardConstants.ENTITY_REPORT.equals(entity)) {
                type = DBObject.REPORTS_GROUP;
            } else {
                type = DBObject.CHARTS_GROUP;
            }
            createSelectionDialog(type);
        }
    });

    add(nameLabel = new JLabel(I18NSupport.getString("wizard.publish.file.name")), new GridBagConstraints(0, 0,
            1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
    add(nameTextField, new GridBagConstraints(1, 0, 2, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 0), 0, 0));
    add(pathLabel = new JLabel(I18NSupport.getString("wizard.publish.file.path")), new GridBagConstraints(0, 1,
            1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
    add(pathTextField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 0), 0, 0));
    add(selectPathButton, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 5, 5, 0), 0, 0));
    add(sourceLabel = new JLabel(I18NSupport.getString("wizard.publish.file.source")), new GridBagConstraints(0,
            2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 5, 0), 0, 0));
    add(dataSourceTextField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 0), 0, 0));
    add(selectDataSourceButton, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST,
            GridBagConstraints.NONE, new Insets(0, 5, 5, 0), 0, 0));
    add(descriptionLabel = new JLabel(I18NSupport.getString("wizard.publish.file.description")),
            new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                    new Insets(0, 0, 0, 0), 0, 0));
    add(scrArea, new GridBagConstraints(1, 3, 2, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH,
            new Insets(0, 5, 0, 0), 0, 0));

}

From source file:org.nuclos.client.layout.wysiwyg.component.properties.PropertyChartPropertyDomainStep.java

@Override
public void prepare() {
    super.prepare();

    chart = model.getChart();//from  w w w.j  ava  2s .  c o m
    wysiwygChart = model.getWYSIWYGChart();

    String sPrefix = getChartProperty(Chart.PROPERTY_COMBINED_PREFIXES);
    combinedPrefixes = (sPrefix == null) ? new StringBuffer("") : new StringBuffer(sPrefix);

    panel = new JPanel();
    panel.setLayout(new BorderLayout());

    final ChartFunction chartFunction = getChartFunction();

    if (!chartFunction.isCombinedChart()) {
        panel.add(getPanelComponent(chartFunction, ""), BorderLayout.CENTER);
    } else {
        JPanel editorType = new JPanel();
        editorType.setLayout(new GridBagLayout());
        JLabel propTypeValue = new JLabel(
                //SpringLocaleDelegate.getInstance().getMessage("wysiwyg.chart.wizard.domain.value",
                "Diagramm hinzufgen:"/*)*/);
        editorType.add(propTypeValue, new GridBagConstraints(0, 0, 0, 1, 1D, 1D, GridBagConstraints.NORTHWEST,
                GridBagConstraints.HORIZONTAL, new Insets(5, 0, 0, 0), 0, 0));
        final JComboBox propTypeComponent = new JComboBox(chartFunction.getCombinedChartFunctions());
        editorType.add(propTypeComponent, new GridBagConstraints(0, 1, 1, 1, 1D, 1D,
                GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 15, 0), 0, 0));

        final JTabbedPane tabbedPane = new JTabbedPane();

        JButton removeButton = new JButton(iconRemove);
        removeButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                if (tabbedPane.getSelectedIndex() != -1) {
                    PanelComponent panelComponent = (PanelComponent) tabbedPane.getSelectedComponent();
                    combinedPrefixes = new StringBuffer(
                            combinedPrefixes.toString().replaceAll(panelComponent.prefix, ""));
                    tabbedPane.remove(panelComponent);
                }
            }
        });
        editorType.add(removeButton, new GridBagConstraints(1, 1, 1, 1, 1D, 1D, GridBagConstraints.NORTHEAST,
                GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
        JButton addButton = new JButton(iconAdd);
        addButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                ChartFunction cFunction = (ChartFunction) propTypeComponent.getSelectedItem();
                String prefix = cFunction.name() + "." + (Math.random() + "").replaceAll("\\.", "") + ":";

                combinedPrefixes.append(prefix);
                tabbedPane.add(cFunction.name(), getPanelComponent(cFunction, prefix));
                tabbedPane.setSelectedIndex(tabbedPane.getTabCount() - 1);
            }
        });
        editorType.add(addButton, new GridBagConstraints(2, 1, 1, 1, 1D, 1D, GridBagConstraints.NORTHWEST,
                GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));

        String[] prefixes = combinedPrefixes.toString().split(":");
        for (String prefix : prefixes) {
            if (prefix.length() > 0) {
                try {
                    ChartFunction cFunction = ChartFunction.valueOf(prefix.split("\\.")[0]);
                    tabbedPane.add(cFunction.name(), getPanelComponent(cFunction, prefix + ":"));
                } catch (Exception e) {
                    // ignore.
                }
            }
        }
        panel.add(editorType, BorderLayout.NORTH);
        panel.add(tabbedPane, BorderLayout.CENTER);
    }
}

From source file:FontChooser.java

/** This method is called from within the constructor to
* initialize the form./*  w  w w.j  a va 2 s.c  o  m*/
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the FormEditor.
*/
private void initComponents() {
    jPanel3 = new javax.swing.JPanel();
    jFont = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    jFontList = new javax.swing.JList();
    jPanel4 = new javax.swing.JPanel();
    jStyle = new javax.swing.JTextField();
    jScrollPane2 = new javax.swing.JScrollPane();
    jStyleList = new javax.swing.JList();
    jPanel5 = new javax.swing.JPanel();
    jSize = new javax.swing.JTextField();
    jScrollPane3 = new javax.swing.JScrollPane();
    jSizeList = new javax.swing.JList();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane4 = new javax.swing.JScrollPane();
    jSample = new javax.swing.JTextArea();
    jButtons = new javax.swing.JPanel();
    jOk = new javax.swing.JButton();
    jCancel = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    getContentPane().setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints1;
    setTitle("Font Chooser");
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            closeDialog(evt);
        }
    });

    jPanel3.setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints2;
    jPanel3.setBorder(new javax.swing.border.TitledBorder(new javax.swing.border.EtchedBorder(), " Font "));

    jFont.setColumns(24);
    jFont.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jFontActionPerformed(evt);
        }
    });
    gridBagConstraints2 = new java.awt.GridBagConstraints();
    gridBagConstraints2.gridwidth = 0;
    gridBagConstraints2.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints2.insets = new java.awt.Insets(0, 3, 0, 3);
    gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints2.weightx = 1.0;
    jPanel3.add(jFont, gridBagConstraints2);

    jFontList.setModel(new DefaultListModel());
    jFontList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jFontList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jFontListValueChanged(evt);
        }
    });
    jScrollPane1.setViewportView(jFontList);

    gridBagConstraints2 = new java.awt.GridBagConstraints();
    gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints2.insets = new java.awt.Insets(3, 3, 3, 3);
    gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints2.weightx = 1.0;
    gridBagConstraints2.weighty = 1.0;
    jPanel3.add(jScrollPane1, gridBagConstraints2);

    gridBagConstraints1 = new java.awt.GridBagConstraints();
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 0);
    gridBagConstraints1.weightx = 0.5;
    gridBagConstraints1.weighty = 1.0;
    getContentPane().add(jPanel3, gridBagConstraints1);

    jPanel4.setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints3;
    jPanel4.setBorder(new javax.swing.border.TitledBorder(new javax.swing.border.EtchedBorder(), " Style "));

    jStyle.setColumns(18);
    jStyle.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jStyleActionPerformed(evt);
        }
    });
    gridBagConstraints3 = new java.awt.GridBagConstraints();
    gridBagConstraints3.gridwidth = 0;
    gridBagConstraints3.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints3.insets = new java.awt.Insets(0, 3, 0, 3);
    gridBagConstraints3.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints3.weightx = 1.0;
    jPanel4.add(jStyle, gridBagConstraints3);

    jStyleList.setModel(new DefaultListModel());
    jStyleList.setVisibleRowCount(4);
    jStyleList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jStyleListValueChanged(evt);
        }
    });
    jScrollPane2.setViewportView(jStyleList);

    gridBagConstraints3 = new java.awt.GridBagConstraints();
    gridBagConstraints3.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints3.insets = new java.awt.Insets(3, 3, 3, 3);
    gridBagConstraints3.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints3.weightx = 0.5;
    gridBagConstraints3.weighty = 1.0;
    jPanel4.add(jScrollPane2, gridBagConstraints3);

    gridBagConstraints1 = new java.awt.GridBagConstraints();
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 0);
    gridBagConstraints1.weightx = 0.375;
    gridBagConstraints1.weighty = 1.0;
    getContentPane().add(jPanel4, gridBagConstraints1);

    jPanel5.setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints4;
    jPanel5.setBorder(new javax.swing.border.TitledBorder(new javax.swing.border.EtchedBorder(), " Size "));

    jSize.setColumns(6);
    jSize.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jSizeActionPerformed(evt);
        }
    });
    gridBagConstraints4 = new java.awt.GridBagConstraints();
    gridBagConstraints4.gridwidth = 0;
    gridBagConstraints4.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints4.insets = new java.awt.Insets(0, 3, 0, 3);
    gridBagConstraints4.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints4.weightx = 1.0;
    jPanel5.add(jSize, gridBagConstraints4);

    jSizeList.setModel(new DefaultListModel());
    jSizeList.setVisibleRowCount(4);
    jSizeList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jSizeList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
        public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            jSizeListValueChanged(evt);
        }
    });
    jScrollPane3.setViewportView(jSizeList);

    gridBagConstraints4 = new java.awt.GridBagConstraints();
    gridBagConstraints4.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints4.insets = new java.awt.Insets(3, 3, 3, 3);
    gridBagConstraints4.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints4.weightx = 0.25;
    gridBagConstraints4.weighty = 1.0;
    jPanel5.add(jScrollPane3, gridBagConstraints4);

    gridBagConstraints1 = new java.awt.GridBagConstraints();
    gridBagConstraints1.gridwidth = 0;
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.insets = new java.awt.Insets(5, 5, 0, 5);
    gridBagConstraints1.weightx = 0.125;
    gridBagConstraints1.weighty = 1.0;
    getContentPane().add(jPanel5, gridBagConstraints1);

    jPanel1.setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints5;
    jPanel1.setBorder(new javax.swing.border.TitledBorder(new javax.swing.border.EtchedBorder(), " Sample "));

    jSample.setWrapStyleWord(true);
    jSample.setLineWrap(true);
    jSample.setColumns(20);
    jSample.setRows(3);
    jSample.setText("The quick brown fox jumped over the lazy dog.");
    jScrollPane4.setViewportView(jSample);

    gridBagConstraints5 = new java.awt.GridBagConstraints();
    gridBagConstraints5.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints5.insets = new java.awt.Insets(0, 3, 3, 3);
    gridBagConstraints5.weightx = 1.0;
    gridBagConstraints5.weighty = 1.0;
    jPanel1.add(jScrollPane4, gridBagConstraints5);

    gridBagConstraints1 = new java.awt.GridBagConstraints();
    gridBagConstraints1.gridwidth = 0;
    gridBagConstraints1.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints1.insets = new java.awt.Insets(0, 5, 0, 5);
    gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints1.weightx = 1.0;
    getContentPane().add(jPanel1, gridBagConstraints1);

    jButtons.setLayout(new java.awt.GridBagLayout());
    java.awt.GridBagConstraints gridBagConstraints6;

    jOk.setMnemonic(KeyEvent.VK_O);
    jOk.setText("OK");
    jOk.setRequestFocusEnabled(false);
    jOk.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jOkActionPerformed(evt);
        }
    });
    gridBagConstraints6 = new java.awt.GridBagConstraints();
    gridBagConstraints6.insets = new java.awt.Insets(5, 5, 5, 0);
    gridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST;
    jButtons.add(jOk, gridBagConstraints6);

    jCancel.setMnemonic(KeyEvent.VK_C);
    jCancel.setText("Cancel");
    jCancel.setRequestFocusEnabled(false);
    jCancel.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jCancelActionPerformed(evt);
        }
    });
    gridBagConstraints6 = new java.awt.GridBagConstraints();
    gridBagConstraints6.gridwidth = 0;
    gridBagConstraints6.insets = new java.awt.Insets(5, 5, 5, 5);
    gridBagConstraints6.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints6.weightx = 1.0;
    jButtons.add(jCancel, gridBagConstraints6);

    gridBagConstraints6 = new java.awt.GridBagConstraints();
    gridBagConstraints6.weightx = 1.0;
    jButtons.add(jLabel6, gridBagConstraints6);

    gridBagConstraints1 = new java.awt.GridBagConstraints();
    gridBagConstraints1.gridwidth = 0;
    gridBagConstraints1.anchor = java.awt.GridBagConstraints.SOUTHWEST;
    gridBagConstraints1.weightx = 1.0;
    getContentPane().add(jButtons, gridBagConstraints1);
}

From source file:org.rdv.ui.channel.LocalChannelDialog.java

/**
 * Initialize the UI components.//w  w w .  j  ava 2 s. c o m
 */
private void initComponents() {
    RDV rdv = RDV.getInstance(RDV.class);

    JPanel container = new JPanel();
    setContentPane(container);

    container.setLayout(new GridBagLayout());
    GridBagConstraints c = createDefaultGridBagConstraints();

    JLabel nameLabel = new JLabel();
    nameLabel.setName("nameLabel");
    nameLabel.setText(PROPERTY_REPO.getValue(NAME_KEY));

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.gridx = 0;
    c.gridy = 1;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(10, 10, 10, 5);
    container.add(nameLabel, c);

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.gridx = 1;
    c.gridy = 1;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(10, 0, 10, 10);
    container.add(nameTextField, c);
    if (isChannelUpdateOperation()) {
        nameTextField.setEnabled(false);
    }
    JLabel unitLabel = new JLabel();
    unitLabel.setName("unitLabel");
    unitLabel.setText(PROPERTY_REPO.getValue(UNIT_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 2;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 5);
    container.add(unitLabel, c);

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.HORIZONTAL;
    c.weightx = 1;
    c.gridx = 1;
    c.gridy = 2;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 0, 10, 10);
    container.add(unitTextField, c);

    JLabel variablesLabel = new JLabel();
    variablesLabel.setName("variablesLabel");
    variablesLabel.setText(PROPERTY_REPO.getValue(VARIABLES_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 3;
    c.gridwidth = 1;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(variablesLabel, c);

    JPanel variablesPanel = buildVariablesPanel();

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 4;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    c.weightx = 1;
    c.weighty = 1;
    container.add(variablesPanel, c);

    JLabel formulaLabel = new JLabel();
    formulaLabel.setName("formulaLabel");
    formulaLabel.setText(PROPERTY_REPO.getValue(FORMULA_KEY));
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 0;
    c.gridx = 0;
    c.gridy = 5;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(formulaLabel, c);

    JScrollPane formulaScrollPane = new JScrollPane(formulaTextArea);
    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.weightx = 1;
    c.weighty = 1;
    c.gridx = 0;
    c.gridy = 6;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.insets = new java.awt.Insets(0, 10, 10, 10);
    container.add(formulaScrollPane, c);

    JPanel footerPanel = buildFooterPanel();

    c = createDefaultGridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.weightx = 0.5;
    c.weighty = 0;
    c.gridx = 0;
    c.gridy = 7;
    c.gridwidth = GridBagConstraints.REMAINDER;
    ;
    c.anchor = GridBagConstraints.LINE_END;
    c.insets = new java.awt.Insets(0, 0, 10, 5);
    container.add(footerPanel, c);

    // bind keystrokes
    InputMap inputMap = container.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    inputMap.put(KeyStroke.getKeyStroke("ENTER"), "addChannel");
    inputMap.put(KeyStroke.getKeyStroke("ESCAPE"), "cancel");

    // initially disable buttons
    removeVariableButton.setEnabled(false);

    pack();

    setLocationByPlatform(true);
    setVisible(true);
}

From source file:de.tbuchloh.kiskis.gui.SecuredElementView.java

private Component createMainTab() {
    final JPanel textFields = new JPanel(new SpringLayout());
    textFields.setBorder(LnFHelper.createDefaultBorder());

    final JLabel nameLabel = LnFHelper.createLabel(M.getString("name_label")); //$NON-NLS-1$
    nameLabel.setVerticalAlignment(SwingConstants.TOP);
    nameLabel.setLabelFor(_name);/*from w  ww  .jav  a 2 s  .com*/
    textFields.add(nameLabel);
    textFields.add(_name);

    final JLabel pwdLabel = LnFHelper.createLabel(M.getString("password_label")); //$NON-NLS-1$
    pwdLabel.setVerticalAlignment(SwingConstants.TOP);
    pwdLabel.setLabelFor(_pwdField);
    textFields.add(pwdLabel);
    textFields.add(_pwdField);

    final JPanel datePanel = new JPanel();
    final GridBagBuilder builder = new GridBagBuilder(datePanel);
    builder.setAlignment(GridBagConstraints.NORTHWEST);
    builder.add(_dateField);
    builder.add(_neverBox);

    builder.setFill(GridBagConstraints.NONE);
    builder.setAlignment(GridBagConstraints.EAST);
    builder.addLast(_historyLink);
    builder.setFill(GridBagConstraints.BOTH);
    builder.setAlignment(GridBagConstraints.NORTHWEST);

    final JLabel expiresLabel = LnFHelper.createLabel(M.getString("expires_label")); //$NON-NLS-1$
    expiresLabel.setVerticalAlignment(SwingConstants.TOP);
    expiresLabel.setLabelFor(datePanel);
    textFields.add(expiresLabel);
    textFields.add(datePanel);

    SpringUtilities.makeCompactGrid(textFields, 3, 2, 5, 5, 5, 5);

    return textFields;
}

From source file:org.zaproxy.zap.extension.encoder2.EncodeDecodeDialog.java

/**
 * This method initializes jPanel/*  w w  w .j a v  a 2s .  c  o  m*/
 *
 * @return javax.swing.JPanel
 */
private JPanel getJTabbed() {
    if (jPanel == null) {
        /*
        jPanel = new JPanel();
        jPanel.setPreferredSize(new java.awt.Dimension(800,600));
                
        jPanel.setLayout(new GridBagLayout());
        */

        // jPanel is the outside one
        jPanel = new JPanel();
        jPanel.setPreferredSize(new java.awt.Dimension(800, 600));
        jPanel.setLayout(new GridBagLayout());

        jTabbed = new JTabbedPane();
        jTabbed.setPreferredSize(new java.awt.Dimension(800, 500));

        final JPanel jPanel1 = new JPanel();
        jPanel1.setLayout(new GridBagLayout());

        final JPanel jPanel2 = new JPanel();
        //jPanel2.setPreferredSize(new java.awt.Dimension(800,500));
        jPanel2.setLayout(new GridBagLayout());

        final JPanel jPanel3 = new JPanel();

        //jPanel3.setPreferredSize(new java.awt.Dimension(800,500));
        jPanel3.setLayout(new GridBagLayout());

        final JPanel jPanel4 = new JPanel();
        jPanel4.setLayout(new GridBagLayout());

        // 3 tabs - Encode, Decode, Hash??
        addField(jPanel1, 1, getBase64EncodeField(), Constant.messages.getString("enc2.label.b64Enc"));
        addField(jPanel1, 2, getUrlEncodeField(), Constant.messages.getString("enc2.label.urlEnc"));
        addField(jPanel1, 3, getAsciiHexEncodeField(), Constant.messages.getString("enc2.label.asciiEnc"));
        addField(jPanel1, 4, getHTMLEncodeField(), Constant.messages.getString("enc2.label.HTMLEnc"));
        addField(jPanel1, 5, getJavaScriptEncodeField(),
                Constant.messages.getString("enc2.label.JavaScriptEnc"));

        addField(jPanel2, 1, getBase64DecodeField(), Constant.messages.getString("enc2.label.b64Dec"));
        addField(jPanel2, 2, getUrlDecodeField(), Constant.messages.getString("enc2.label.urlDec"));
        addField(jPanel2, 3, getAsciiHexDecodeField(), Constant.messages.getString("enc2.label.asciiDec"));
        addField(jPanel2, 4, getHTMLDecodeField(), Constant.messages.getString("enc2.label.HTMLDec"));
        addField(jPanel2, 5, getJavaScriptDecodeField(),
                Constant.messages.getString("enc2.label.JavaScriptDec"));

        addField(jPanel3, 1, getSha1HashField(), Constant.messages.getString("enc2.label.sha1Hash"));
        addField(jPanel3, 2, getMd5HashField(), Constant.messages.getString("enc2.label.md5Hash"));

        addField(jPanel4, 1, getIllegalUTF82ByteField(),
                Constant.messages.getString("enc2.label.illegalUTF8.2byte"));
        addField(jPanel4, 2, getIllegalUTF83ByteField(),
                Constant.messages.getString("enc2.label.illegalUTF8.3byte"));
        addField(jPanel4, 3, getIllegalUTF84ByteField(),
                Constant.messages.getString("enc2.label.illegalUTF8.4byte"));

        jTabbed.addTab(Constant.messages.getString("enc2.tab.encode"), jPanel1);
        jTabbed.addTab(Constant.messages.getString("enc2.tab.decode"), jPanel2);
        jTabbed.addTab(Constant.messages.getString("enc2.tab.hash"), jPanel3);
        jTabbed.addTab(Constant.messages.getString("enc2.tab.illegalUTF8"), jPanel4);

        final java.awt.GridBagConstraints gbc1 = new GridBagConstraints();
        gbc1.gridx = 0;
        gbc1.gridy = 1;
        gbc1.insets = new java.awt.Insets(1, 1, 1, 1);
        gbc1.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gbc1.fill = java.awt.GridBagConstraints.BOTH;
        gbc1.weightx = 1.0D;
        gbc1.weighty = 0.25D;

        final java.awt.GridBagConstraints gbc2 = new GridBagConstraints();
        gbc2.gridx = 0;
        gbc2.gridy = 2;
        gbc2.insets = new java.awt.Insets(1, 1, 1, 1);
        gbc2.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gbc2.fill = java.awt.GridBagConstraints.BOTH;
        gbc2.weightx = 1.0D;
        gbc2.weighty = 1.0D;

        final JScrollPane jsp = new JScrollPane();
        jsp.setViewportView(getInputField());
        jsp.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jsp.setBorder(BorderFactory.createTitledBorder(null, Constant.messages.getString("enc2.label.text"),
                TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION,
                FontUtils.getFont(FontUtils.Size.standard), java.awt.Color.black));

        //addField(jPanel, 1, getInputField(), "Text to be encoded/decoded/hashed");
        //addField(jPanel, 2, jTabbed, "Text to be encoded/decoded/hashed");

        jPanel.add(jsp, gbc1);
        jPanel.add(jTabbed, gbc2);

        jPanel2.requestFocus();

    }
    return jPanel;
}

From source file:com.limegroup.gnutella.gui.LicenseWindow.java

protected void createValid() {
    GridBagConstraints c = new GridBagConstraints();
    JComponent label = new JLabel(getDetailsString());
    Font f = label.getFont();/*from  w  w  w. j  a  va 2 s. c o m*/
    label.setFont(new Font(f.getName(), Font.BOLD, f.getSize()));
    c.fill = GridBagConstraints.HORIZONTAL;
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.anchor = GridBagConstraints.NORTHWEST;
    DETAILS.add(label, c);

    JTextArea text = newTextArea(LICENSE.getLicenseDescription(URN));
    c.gridwidth = GridBagConstraints.RELATIVE;
    c.gridheight = 2;
    c.weighty = 1;
    c.weightx = .7;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.BOTH;
    DETAILS.add(text, c);

    if (LICENSE.getLicenseDeed(URN) != null) {
        label = new URLLabel(LICENSE.getLicenseDeed(URN), getDeedString());
    } else {
        label = new JLabel();
        label.setVisible(false);
    }
    c.gridwidth = GridBagConstraints.REMAINDER;
    c.gridheight = 1;
    c.weighty = 0;
    c.weightx = .3;
    c.anchor = GridBagConstraints.NORTHWEST;
    c.fill = GridBagConstraints.BOTH;
    c.insets = new Insets(0, 0, 3, 0);
    DETAILS.add(label, c);

    label = new URLLabel(LICENSE.getLicenseURI(), getVerificationString());
    DETAILS.add(label, c);
}

From source file:au.org.ala.delta.intkey.ui.DefineButtonDialog.java

public DefineButtonDialog(Frame owner, boolean modal) {
    super(owner, modal);
    setPreferredSize(new Dimension(500, 430));

    ResourceMap resourceMap = Application.getInstance().getContext().getResourceMap(DefineButtonDialog.class);
    resourceMap.injectFields(this);
    ActionMap actionMap = Application.getInstance().getContext().getActionMap(DefineButtonDialog.class, this);

    setTitle(title);//from  w w w  .ja v a  2s  .co  m

    _okButtonPressed = false;

    _pnlButtons = new JPanel();
    getContentPane().add(_pnlButtons, BorderLayout.SOUTH);

    _btnOk = new JButton();
    _btnOk.setAction(actionMap.get("DefineButtonDialog_OK"));
    _pnlButtons.add(_btnOk);

    _btnCancel = new JButton();
    _btnCancel.setAction(actionMap.get("DefineButtonDialog_Cancel"));
    _pnlButtons.add(_btnCancel);

    _btnHelp = new JButton();
    _btnHelp.setAction(actionMap.get("DefineButtonDialog_Help"));
    _btnHelp.setEnabled(false);
    _pnlButtons.add(_btnHelp);

    _pnlMain = new JPanel();
    getContentPane().add(_pnlMain, BorderLayout.CENTER);
    _pnlMain.setLayout(new BorderLayout(5, 0));

    _pnlButtonProperties = new JPanel();
    _pnlButtonProperties.setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new CompoundBorder(
            new EtchedBorder(EtchedBorder.LOWERED, null, null), new EmptyBorder(5, 5, 5, 5))));
    _pnlMain.add(_pnlButtonProperties, BorderLayout.NORTH);
    GridBagLayout gbl__pnlButtonProperties = new GridBagLayout();
    gbl__pnlButtonProperties.columnWidths = new int[] { 475, 0 };
    gbl__pnlButtonProperties.rowHeights = new int[] { 14, 23, 14, 20, 14, 20, 14, 0, 23, 23, 23, 23, 0 };
    gbl__pnlButtonProperties.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl__pnlButtonProperties.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, Double.MIN_VALUE };
    _pnlButtonProperties.setLayout(gbl__pnlButtonProperties);

    _lblEnterNameOf = new JLabel(enterFileNameCaption);
    _lblEnterNameOf.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc__lblEnterNameOf = new GridBagConstraints();
    gbc__lblEnterNameOf.anchor = GridBagConstraints.WEST;
    gbc__lblEnterNameOf.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterNameOf.gridx = 0;
    gbc__lblEnterNameOf.gridy = 0;
    _pnlButtonProperties.add(_lblEnterNameOf, gbc__lblEnterNameOf);

    _pnlFile = new JPanel();
    GridBagConstraints gbc__pnlFile = new GridBagConstraints();
    gbc__pnlFile.fill = GridBagConstraints.HORIZONTAL;
    gbc__pnlFile.insets = new Insets(0, 0, 5, 0);
    gbc__pnlFile.gridx = 0;
    gbc__pnlFile.gridy = 1;
    _pnlButtonProperties.add(_pnlFile, gbc__pnlFile);
    _pnlFile.setLayout(new BorderLayout(0, 0));

    _txtFldFileName = new JTextField();
    _pnlFile.add(_txtFldFileName, BorderLayout.CENTER);
    _txtFldFileName.setColumns(10);

    _btnBrowse = new JButton();
    _btnBrowse.setAction(actionMap.get("DefineButtonDialog_Browse"));
    _pnlFile.add(_btnBrowse, BorderLayout.EAST);

    _lblEnterTheCommands = new JLabel(enterCommandsCaption);
    _lblEnterTheCommands.setHorizontalAlignment(SwingConstants.LEFT);
    GridBagConstraints gbc__lblEnterTheCommands = new GridBagConstraints();
    gbc__lblEnterTheCommands.anchor = GridBagConstraints.WEST;
    gbc__lblEnterTheCommands.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterTheCommands.gridx = 0;
    gbc__lblEnterTheCommands.gridy = 2;
    _pnlButtonProperties.add(_lblEnterTheCommands, gbc__lblEnterTheCommands);

    _txtFldCommands = new JTextField();
    GridBagConstraints gbc__txtFldCommands = new GridBagConstraints();
    gbc__txtFldCommands.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldCommands.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldCommands.gridx = 0;
    gbc__txtFldCommands.gridy = 3;
    _pnlButtonProperties.add(_txtFldCommands, gbc__txtFldCommands);
    _txtFldCommands.setColumns(10);

    _lblEnterBriefHelp = new JLabel(enterBriefHelpCaption);
    _lblEnterBriefHelp.setAlignmentY(Component.TOP_ALIGNMENT);
    GridBagConstraints gbc__lblEnterBriefHelp = new GridBagConstraints();
    gbc__lblEnterBriefHelp.anchor = GridBagConstraints.NORTHWEST;
    gbc__lblEnterBriefHelp.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterBriefHelp.gridx = 0;
    gbc__lblEnterBriefHelp.gridy = 4;
    _pnlButtonProperties.add(_lblEnterBriefHelp, gbc__lblEnterBriefHelp);

    _txtFldBriefHelp = new JTextField();
    GridBagConstraints gbc__txtFldBriefHelp = new GridBagConstraints();
    gbc__txtFldBriefHelp.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldBriefHelp.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldBriefHelp.gridx = 0;
    gbc__txtFldBriefHelp.gridy = 5;
    _pnlButtonProperties.add(_txtFldBriefHelp, gbc__txtFldBriefHelp);
    _txtFldBriefHelp.setColumns(10);

    _lblEnterMoreDetailed = new JLabel(enterDetailedHelpCaption);
    GridBagConstraints gbc__lblEnterMoreDetailed = new GridBagConstraints();
    gbc__lblEnterMoreDetailed.anchor = GridBagConstraints.WEST;
    gbc__lblEnterMoreDetailed.insets = new Insets(0, 0, 5, 0);
    gbc__lblEnterMoreDetailed.gridx = 0;
    gbc__lblEnterMoreDetailed.gridy = 6;
    _pnlButtonProperties.add(_lblEnterMoreDetailed, gbc__lblEnterMoreDetailed);

    _txtFldDetailedHelp = new JTextField();
    GridBagConstraints gbc__txtFldDetailedHelp = new GridBagConstraints();
    gbc__txtFldDetailedHelp.insets = new Insets(0, 0, 5, 0);
    gbc__txtFldDetailedHelp.fill = GridBagConstraints.HORIZONTAL;
    gbc__txtFldDetailedHelp.gridx = 0;
    gbc__txtFldDetailedHelp.gridy = 7;
    _pnlButtonProperties.add(_txtFldDetailedHelp, gbc__txtFldDetailedHelp);
    _txtFldDetailedHelp.setColumns(10);

    _chckbxEnableOnlyIfUsedCharacters = new JCheckBox(enableOnlyIfUsedCaption);
    GridBagConstraints gbc__chckbxEnableOnlyIf = new GridBagConstraints();
    gbc__chckbxEnableOnlyIf.anchor = GridBagConstraints.WEST;
    gbc__chckbxEnableOnlyIf.insets = new Insets(0, 0, 5, 0);
    gbc__chckbxEnableOnlyIf.gridx = 0;
    gbc__chckbxEnableOnlyIf.gridy = 8;
    _pnlButtonProperties.add(_chckbxEnableOnlyIfUsedCharacters, gbc__chckbxEnableOnlyIf);

    _rdbtnEnableInAll = new JRadioButton(enableInAllModesCaption);
    GridBagConstraints gbc__rdbtnEnableInAll = new GridBagConstraints();
    gbc__rdbtnEnableInAll.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInAll.insets = new Insets(0, 0, 5, 0);
    gbc__rdbtnEnableInAll.gridx = 0;
    gbc__rdbtnEnableInAll.gridy = 9;
    _pnlButtonProperties.add(_rdbtnEnableInAll, gbc__rdbtnEnableInAll);

    _rdbtnEnableInNormal = new JRadioButton(enableInNormalModeCaption);
    GridBagConstraints gbc__rdbtnEnableInNormal = new GridBagConstraints();
    gbc__rdbtnEnableInNormal.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInNormal.insets = new Insets(0, 0, 5, 0);
    gbc__rdbtnEnableInNormal.gridx = 0;
    gbc__rdbtnEnableInNormal.gridy = 10;
    _pnlButtonProperties.add(_rdbtnEnableInNormal, gbc__rdbtnEnableInNormal);

    _rdbtnEnableInAdvanced = new JRadioButton(enableInAdvancedModeCaption);
    GridBagConstraints gbc__rdbtnEnableInAdvanced = new GridBagConstraints();
    gbc__rdbtnEnableInAdvanced.anchor = GridBagConstraints.WEST;
    gbc__rdbtnEnableInAdvanced.gridx = 0;
    gbc__rdbtnEnableInAdvanced.gridy = 11;
    _pnlButtonProperties.add(_rdbtnEnableInAdvanced, gbc__rdbtnEnableInAdvanced);

    _pnlSpaceRemoveAll = new JPanel();
    _pnlSpaceRemoveAll.setBorder(new EmptyBorder(0, 10, 0, 0));
    _pnlMain.add(_pnlSpaceRemoveAll, BorderLayout.SOUTH);
    _pnlSpaceRemoveAll.setLayout(new BoxLayout(_pnlSpaceRemoveAll, BoxLayout.Y_AXIS));

    _chckbxInsertASpace = new JCheckBox(insertSpaceCaption);
    _chckbxInsertASpace.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            _insertSpace = !_insertSpace;

            if (_insertSpace) {
                _removeAllButtons = false;
                _chckbxRemoveAllButtons.setSelected(false);
            }

            updateButtonPropertyControls();
        }
    });
    _pnlSpaceRemoveAll.add(_chckbxInsertASpace);

    _chckbxRemoveAllButtons = new JCheckBox(removeAllCaption);
    _chckbxRemoveAllButtons.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            _removeAllButtons = !_removeAllButtons;

            if (_removeAllButtons) {
                _insertSpace = false;
                _chckbxInsertASpace.setSelected(false);
            }

            updateButtonPropertyControls();
        }
    });
    _pnlSpaceRemoveAll.add(_chckbxRemoveAllButtons);

    _pnlButtonProperties.setEnabled(false);

    ButtonGroup btnGroup = new ButtonGroup();
    btnGroup.add(_rdbtnEnableInAll);
    btnGroup.add(_rdbtnEnableInNormal);
    btnGroup.add(_rdbtnEnableInAdvanced);

    _rdbtnEnableInAll.setSelected(true);
}

From source file:org.zaproxy.zap.extension.bruteforce.BruteForcePanel.java

/**
 * This method initializes panelCommand//  w  w  w.  ja v a  2  s.  c om
 *
 * @return javax.swing.JPanel
 */
private javax.swing.JPanel getPanelCommand() {
    if (panelCommand == null) {

        panelCommand = new javax.swing.JPanel();
        panelCommand.setLayout(new java.awt.GridBagLayout());
        panelCommand.setName("BruteForce");

        GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();

        gridBagConstraints1.gridx = 0;
        gridBagConstraints1.gridy = 0;
        gridBagConstraints1.insets = new java.awt.Insets(2, 2, 2, 2);
        gridBagConstraints1.anchor = java.awt.GridBagConstraints.NORTHWEST;
        gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints1.weightx = 1.0D;

        gridBagConstraints2.gridx = 0;
        gridBagConstraints2.gridy = 1;
        gridBagConstraints2.weightx = 1.0;
        gridBagConstraints2.weighty = 1.0;
        gridBagConstraints2.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints2.insets = new java.awt.Insets(0, 0, 0, 0);
        gridBagConstraints2.anchor = java.awt.GridBagConstraints.NORTHWEST;

        panelCommand.add(this.getPanelToolbar(), gridBagConstraints1);
        panelCommand.add(getJScrollPane(), gridBagConstraints2);
    }
    return panelCommand;
}