Search in sources :

Example 11 with JCheckBox

use of javax.swing.JCheckBox in project gephi by gephi.

the class ImportCSVUIVisualPanel2 method loadNodesTableSettings.

private void loadNodesTableSettings(JPanel settingsPanel) {
    //Create assignNewNodeIds checkbox and set its selection with saved preferences or true by default:
    assignNewNodeIds = new JCheckBox(getMessage("ImportCSVUIVisualPanel2.nodes.assign-ids-checkbox"), NbPreferences.forModule(ImportCSVUIVisualPanel1.class).getBoolean(ASSIGN_NEW_NODES_IDS_SAVED_PREFERENCES, //False => by default update nodes instead of creating new ones
    false));
    settingsPanel.add(assignNewNodeIds, "wrap");
}
Also used : JCheckBox(javax.swing.JCheckBox)

Example 12 with JCheckBox

use of javax.swing.JCheckBox in project gephi by gephi.

the class ColumnSelectionPanel method init.

public void init(ColumnSelectionModel[] columns) {
    int i = 0;
    int j = 0;
    int width = 1;
    int rows = columns.length / width;
    for (int col = 0; col < columns.length; col++) {
        if (i >= rows) {
            i = 0;
            j++;
        }
        ColumnSelectionModel column = columns[col];
        JCheckBox checkBox = new JCheckBox();
        checkBox.setText(column.getName());
        checkBox.setSelected(column.isSelected());
        checkBox.setEnabled(column.isEnabled());
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.gridx = j;
        gridBagConstraints.gridy = i + i;
        gridBagConstraints.insets = new java.awt.Insets(0, 12, 0, 12);
        gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraints.weightx = 1;
        add(checkBox, gridBagConstraints);
        checkBoxes.put(column, checkBox);
        i++;
    }
}
Also used : JCheckBox(javax.swing.JCheckBox) GridBagConstraints(java.awt.GridBagConstraints)

Example 13 with JCheckBox

use of javax.swing.JCheckBox in project binnavi by google.

the class AtomicTypePanel method createControls.

private void createControls() {
    setLayout(new BorderLayout());
    final JPanel contentPanel = new JPanel();
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    add(contentPanel, BorderLayout.CENTER);
    final GridBagLayout gbl_m_contentPanel = new GridBagLayout();
    gbl_m_contentPanel.columnWidths = new int[] { 0, 0, 0 };
    gbl_m_contentPanel.rowHeights = new int[] { 0, 0, 0, 0, 0, 0 };
    gbl_m_contentPanel.columnWeights = new double[] { 0.0, 1.0, Double.MIN_VALUE };
    gbl_m_contentPanel.rowWeights = new double[] { 0.0, 0.0, 0.0, 1.0, 0.0, Double.MIN_VALUE };
    contentPanel.setLayout(gbl_m_contentPanel);
    final JLabel lblNewLabel = new JLabel("Name:");
    final GridBagConstraints gbc_lblNewLabel = new GridBagConstraints();
    gbc_lblNewLabel.anchor = GridBagConstraints.WEST;
    gbc_lblNewLabel.insets = new Insets(0, 0, 5, 5);
    gbc_lblNewLabel.gridx = 0;
    gbc_lblNewLabel.gridy = 0;
    contentPanel.add(lblNewLabel, gbc_lblNewLabel);
    name = new JTextField();
    name.addKeyListener(new KeyAdapter() {

        @Override
        public void keyReleased(final KeyEvent e) {
            updatePreview();
        }
    });
    final GridBagConstraints gbc_m_name = new GridBagConstraints();
    gbc_m_name.insets = new Insets(0, 0, 5, 0);
    gbc_m_name.fill = GridBagConstraints.HORIZONTAL;
    gbc_m_name.gridx = 1;
    gbc_m_name.gridy = 0;
    contentPanel.add(name, gbc_m_name);
    name.setColumns(10);
    final JLabel lblSize = new JLabel("Size (bits):");
    final GridBagConstraints gbc_lblSize = new GridBagConstraints();
    gbc_lblSize.anchor = GridBagConstraints.WEST;
    gbc_lblSize.insets = new Insets(0, 0, 5, 5);
    gbc_lblSize.gridx = 0;
    gbc_lblSize.gridy = 1;
    contentPanel.add(lblSize, gbc_lblSize);
    size = new JTextField();
    final GridBagConstraints gbc_m_size = new GridBagConstraints();
    gbc_m_size.insets = new Insets(0, 0, 5, 0);
    gbc_m_size.fill = GridBagConstraints.HORIZONTAL;
    gbc_m_size.gridx = 1;
    gbc_m_size.gridy = 1;
    contentPanel.add(size, gbc_m_size);
    size.setColumns(10);
    signed = new JCheckBox("Signed");
    final GridBagConstraints gbc_m_signed = new GridBagConstraints();
    gbc_m_signed.anchor = GridBagConstraints.WEST;
    gbc_m_signed.insets = new Insets(0, 0, 5, 5);
    gbc_m_signed.gridx = 0;
    gbc_m_signed.gridy = 2;
    contentPanel.add(signed, gbc_m_signed);
    lblPreview = new JLabel("Preview:");
    final GridBagConstraints gbc_lblPreview = new GridBagConstraints();
    gbc_lblPreview.insets = new Insets(0, 0, 5, 5);
    gbc_lblPreview.gridx = 0;
    gbc_lblPreview.gridy = 3;
    contentPanel.add(lblPreview, gbc_lblPreview);
    preview = new JTextArea();
    preview.setEditable(false);
    final GridBagConstraints gbc_preview = new GridBagConstraints();
    gbc_preview.insets = new Insets(0, 0, 5, 0);
    gbc_preview.fill = GridBagConstraints.BOTH;
    gbc_preview.gridx = 1;
    gbc_preview.gridy = 3;
    contentPanel.add(preview, gbc_preview);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JTextArea(javax.swing.JTextArea) GridBagLayout(java.awt.GridBagLayout) KeyAdapter(java.awt.event.KeyAdapter) JLabel(javax.swing.JLabel) JTextField(javax.swing.JTextField) KeyEvent(java.awt.event.KeyEvent) JCheckBox(javax.swing.JCheckBox) BorderLayout(java.awt.BorderLayout) EmptyBorder(javax.swing.border.EmptyBorder)

Example 14 with JCheckBox

use of javax.swing.JCheckBox in project binnavi by google.

the class COptionsPanel method buildRow.

/**
   * Builds a single row of components in the panel.
   * 
   * @param <T> Type of the editing component.
   * 
   * @param panel Panel the editing component is added to.
   * @param description Type description to be configured in that row.
   * @param hint Hint shown as a tooltip.
   * @param component The component to add to the panel.
   * @param isLast True, if the component is the last component to be added to the panel.
   * 
   * @return The panel passed to the function.
   */
private <T extends Component> T buildRow(final JPanel panel, final ITypeDescription description, final String hint, final T component, final boolean isLast) {
    component.setPreferredSize(new Dimension(COLORPANEL_WIDTH, COLORPANEL_HEIGHT));
    final JPanel rowPanel = new JPanel(new BorderLayout());
    rowPanel.setBorder(new EmptyBorder(0, 2, isLast ? 2 : 0, 2));
    final JPanel innerPanel = new JPanel(new GridLayout(1, 2));
    innerPanel.add(new JCheckBox(new CheckboxAction(description, description.getDescription() + ":")), BorderLayout.CENTER);
    innerPanel.add(CHintCreator.createHintPanel(component, hint), BorderLayout.EAST);
    rowPanel.add(innerPanel, BorderLayout.WEST);
    panel.add(rowPanel);
    return component;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) EmptyBorder(javax.swing.border.EmptyBorder)

Example 15 with JCheckBox

use of javax.swing.JCheckBox in project zaproxy by zaproxy.

the class OptionsApiPanel method getEnableJSONP.

private JCheckBox getEnableJSONP() {
    if (enableJSONP == null) {
        enableJSONP = new JCheckBox();
        enableJSONP.setText(Constant.messages.getString("api.options.enableJSONP"));
        enableJSONP.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        enableJSONP.setVerticalTextPosition(javax.swing.SwingConstants.TOP);
    }
    return enableJSONP;
}
Also used : JCheckBox(javax.swing.JCheckBox)

Aggregations

JCheckBox (javax.swing.JCheckBox)372 JPanel (javax.swing.JPanel)146 JLabel (javax.swing.JLabel)112 JButton (javax.swing.JButton)92 ActionEvent (java.awt.event.ActionEvent)71 ActionListener (java.awt.event.ActionListener)66 JTextField (javax.swing.JTextField)57 BorderLayout (java.awt.BorderLayout)52 GridBagConstraints (java.awt.GridBagConstraints)42 BoxLayout (javax.swing.BoxLayout)42 GridBagLayout (java.awt.GridBagLayout)39 Dimension (java.awt.Dimension)33 FlowLayout (java.awt.FlowLayout)31 Insets (java.awt.Insets)31 JScrollPane (javax.swing.JScrollPane)30 JRadioButton (javax.swing.JRadioButton)29 ItemEvent (java.awt.event.ItemEvent)26 ButtonGroup (javax.swing.ButtonGroup)25 ItemListener (java.awt.event.ItemListener)23 JComboBox (javax.swing.JComboBox)23