Search in sources :

Example 6 with BorderLayout

use of java.awt.BorderLayout in project checkstyle by checkstyle.

the class MainFrame method createButtonsPanel.

/**
     * Create buttons panel.
     * @return buttons panel.
     */
private JPanel createButtonsPanel() {
    final JButton openFileButton = new JButton(new FileSelectionAction());
    openFileButton.setMnemonic(KeyEvent.VK_S);
    openFileButton.setText("Open File");
    reloadAction.setEnabled(false);
    final JButton reloadFileButton = new JButton(reloadAction);
    reloadFileButton.setMnemonic(KeyEvent.VK_R);
    reloadFileButton.setText("Reload File");
    final JComboBox<ParseMode> modesCombobox = new JComboBox<>(ParseMode.values());
    modesCombobox.setSelectedIndex(0);
    modesCombobox.addActionListener(e -> {
        model.setParseMode((ParseMode) modesCombobox.getSelectedItem());
        reloadAction.actionPerformed(null);
    });
    final JLabel modesLabel = new JLabel("Modes:", SwingConstants.RIGHT);
    final int leftIndentation = 10;
    modesLabel.setBorder(BorderFactory.createEmptyBorder(0, leftIndentation, 0, 0));
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout(new GridLayout(1, 2));
    buttonPanel.add(openFileButton);
    buttonPanel.add(reloadFileButton);
    final JPanel modesPanel = new JPanel();
    modesPanel.add(modesLabel);
    modesPanel.add(modesCombobox);
    final JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());
    mainPanel.add(buttonPanel);
    mainPanel.add(modesPanel, BorderLayout.LINE_END);
    return mainPanel;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JComboBox(javax.swing.JComboBox) BorderLayout(java.awt.BorderLayout) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) ParseMode(com.puppycrawl.tools.checkstyle.gui.MainFrameModel.ParseMode)

Example 7 with BorderLayout

use of java.awt.BorderLayout in project WordCram by danbernier.

the class MainJFrame method main.

public static void main(String[] args) {
    // This method works!
    //PApplet.main (new String[] { "--present", "--bgcolor=#000000", "--stop-color=#cccccc", "example.Main"});
    // But now this method.
    JFrame frame = new JFrame();
    frame.setLayout(new BorderLayout());
    PApplet sketch = new example.Main();
    frame.add(sketch, BorderLayout.CENTER);
    sketch.init();
    frame.pack();
    frame.show();
}
Also used : BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame)

Example 8 with BorderLayout

use of java.awt.BorderLayout in project buck by facebook.

the class BuckSettingsUI method init.

private void init() {
    setLayout(new BorderLayout());
    JPanel container = this;
    buckPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor buckFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    buckPathField.addBrowseFolderListener("", "Buck Executable Path", null, buckFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    adbPathField = new TextFieldWithBrowseButton();
    FileChooserDescriptor adbFileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false);
    adbPathField.addBrowseFolderListener("", "Adb Executable Path", null, adbFileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT, false);
    customizedInstallSettingField = new JBTextField();
    customizedInstallSettingField.getEmptyText().setText(CUSTOMIZED_INSTALL_FLAGS_HINT);
    customizedInstallSettingField.setEnabled(false);
    showDebug = new JCheckBox("Show debug in tool window");
    enableAutoDeps = new JCheckBox("Enable auto dependencies");
    runAfterInstall = new JCheckBox("Run after install (-r)");
    multiInstallMode = new JCheckBox("Multi-install mode (-x)");
    uninstallBeforeInstall = new JCheckBox("Uninstall before installing (-u)");
    customizedInstallSetting = new JCheckBox("Use customized install setting:  ");
    initCustomizedInstallCommandListener();
    JPanel buckSettings = new JPanel(new GridBagLayout());
    buckSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.NORTH);
    container.add(buckSettings, BorderLayout.NORTH);
    final GridBagConstraints constraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    buckSettings.add(new JLabel("Buck Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(buckPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 1;
    constraints.weightx = 1;
    buckSettings.add(new JLabel("Adb Executable Path:"), constraints);
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.weightx = 1;
    constraints.fill = GridBagConstraints.HORIZONTAL;
    buckSettings.add(adbPathField, constraints);
    constraints.gridx = 0;
    constraints.gridy = 2;
    buckSettings.add(showDebug, constraints);
    constraints.gridx = 0;
    constraints.gridy = 3;
    buckSettings.add(enableAutoDeps, constraints);
    JPanel installSettings = new JPanel(new BorderLayout());
    installSettings.setBorder(IdeBorderFactory.createTitledBorder("Buck Install Settings", true));
    container.add(container = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    container.add(installSettings, BorderLayout.NORTH);
    installSettings.add(runAfterInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(multiInstallMode, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    installSettings.add(uninstallBeforeInstall, BorderLayout.NORTH);
    installSettings.add(installSettings = new JPanel(new BorderLayout()), BorderLayout.SOUTH);
    final GridBagConstraints customConstraints = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0);
    JPanel customizedInstallSetting = new JPanel(new GridBagLayout());
    customizedInstallSetting.add(this.customizedInstallSetting, customConstraints);
    customConstraints.gridx = 1;
    customConstraints.weightx = 1;
    customConstraints.fill = GridBagConstraints.HORIZONTAL;
    customizedInstallSetting.add(customizedInstallSettingField, customConstraints);
    installSettings.add(customizedInstallSetting, BorderLayout.NORTH);
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) Insets(java.awt.Insets) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) JLabel(javax.swing.JLabel) JBTextField(com.intellij.ui.components.JBTextField)

Example 9 with BorderLayout

use of java.awt.BorderLayout in project qi4j-sdk by Qi4j.

the class EntityViewer method $$$setupUI$$$.

/**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     */
private void $$$setupUI$$$() {
    mainPane = new JPanel();
    mainPane.setLayout(new BorderLayout(0, 0));
    splitPane = new JSplitPane();
    mainPane.add(splitPane, BorderLayout.CENTER);
    propertiesAreaPane = new JPanel();
    propertiesAreaPane.setLayout(new BorderLayout(0, 0));
    splitPane.setRightComponent(propertiesAreaPane);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridBagLayout());
    propertiesAreaPane.add(panel1, BorderLayout.NORTH);
    entitiesCombo = new JComboBox();
    GridBagConstraints gbc;
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.gridwidth = 3;
    gbc.weightx = 0.3;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(entitiesCombo, gbc);
    final JLabel label1 = new JLabel();
    label1.setText("Entity");
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label1, gbc);
    final JPanel spacer1 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer1, gbc);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) BorderLayout(java.awt.BorderLayout) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) JSplitPane(javax.swing.JSplitPane)

Example 10 with BorderLayout

use of java.awt.BorderLayout in project qi4j-sdk by Qi4j.

the class APIPane method $$$setupUI$$$.

/**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     */
private void $$$setupUI$$$() {
    contentPane = new JPanel();
    contentPane.setLayout(new BorderLayout(0, 0));
    final JScrollPane scrollPane1 = new JScrollPane();
    contentPane.add(scrollPane1, BorderLayout.CENTER);
    apiTable = new JTable();
    apiTable.setShowVerticalLines(true);
    scrollPane1.setViewportView(apiTable);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTable(javax.swing.JTable)

Aggregations

BorderLayout (java.awt.BorderLayout)761 JPanel (javax.swing.JPanel)514 JLabel (javax.swing.JLabel)238 JScrollPane (javax.swing.JScrollPane)191 Dimension (java.awt.Dimension)155 JButton (javax.swing.JButton)134 FlowLayout (java.awt.FlowLayout)90 ActionEvent (java.awt.event.ActionEvent)88 JTextField (javax.swing.JTextField)85 EmptyBorder (javax.swing.border.EmptyBorder)73 ActionListener (java.awt.event.ActionListener)70 JCheckBox (javax.swing.JCheckBox)69 Insets (java.awt.Insets)64 BoxLayout (javax.swing.BoxLayout)62 GridBagConstraints (java.awt.GridBagConstraints)57 GridBagLayout (java.awt.GridBagLayout)57 JTable (javax.swing.JTable)57 JTextArea (javax.swing.JTextArea)52 GridLayout (java.awt.GridLayout)49 Box (javax.swing.Box)45