Package javax.swing

Examples of javax.swing.GroupLayout$PreferredGapSpring


                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);

        GroupLayout layout = new GroupLayout(this);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(separator, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 226, Short.MAX_VALUE)
                .addComponent(connectionStateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(connectionStateIcon)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(connectionStateIcon)
                    .addComponent(connectionStateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );
View Full Code Here


                statusMessageLabel.setText("");
            }
        });
        messageTimer.setRepeats(false);

        GroupLayout layout = new GroupLayout(this);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(separator, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusMessageLabel)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 226, Short.MAX_VALUE)
                .addComponent(connectionStateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(connectionStateIcon)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(statusMessageLabel)
                    .addComponent(connectionStateIcon)
                    .addComponent(connectionStateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(3, 3, 3))
        );
View Full Code Here

        return buttonsPanel;
    }

    private JPanel createGeneralPanel(ApplicationActionMap actionMap, ResourceMap resourceMap) {
        JPanel generalPanel = new JPanel();
        GroupLayout gl = new GroupLayout(generalPanel);
        generalPanel.setLayout(gl);
        gl.setAutoCreateGaps(true);
        gl.setAutoCreateContainerGaps(true);

        JLabel fsBackgroundLabel = new JLabel();
        fsBackgroundLabel.setName("fsBackgroundLabel");
        fsBackgroundPreview = new JPanel();
        fsBackgroundPreview.setBorder(new LineBorder(Color.GRAY));
        fsBackgroundPreview.setPreferredSize(new Dimension(20, 10));
        JButton fsBackgroundButton = new JButton(actionMap.get(ACTION_SET_FS_BACKGROUND));

        skipDuplicatesCheckBox = new JCheckBox();
        skipDuplicatesCheckBox.setName("skipDuplicatesCheckBox");
        saveOriginalCheckBox = new JCheckBox();
        saveOriginalCheckBox.setName("saveOriginalCheckBox");
        JLabel offsetLabel = new JLabel();
        offsetLabel.setName("offsetLabel");
        offsetSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 100, 1));
        offsetSpinner.setName("offsetSpinner");

        updateCheckBox = new JCheckBox();
        updateCheckBox.setName("updateCheckBox");

        gl.setHorizontalGroup(gl.createParallelGroup()
            .addComponent(saveOriginalCheckBox)
            .addComponent(skipDuplicatesCheckBox)
            .addGroup(gl.createSequentialGroup()
                .addComponent(offsetLabel)
                .addComponent(offsetSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                )
            .addGroup(gl.createSequentialGroup()
                .addComponent(fsBackgroundLabel)
                .addComponent(fsBackgroundPreview)
                .addComponent(fsBackgroundButton)
                )
            );
        gl.setVerticalGroup(gl.createSequentialGroup()
            .addComponent(saveOriginalCheckBox)
            .addComponent(skipDuplicatesCheckBox)
            .addGroup(gl.createBaselineGroup(false, true)
                .addComponent(offsetLabel)
                .addComponent(offsetSpinner)
                )
            .addGroup(gl.createBaselineGroup(false, true)
                .addComponent(fsBackgroundLabel)
                .addComponent(fsBackgroundPreview)
                .addComponent(fsBackgroundButton)
                )
            );
View Full Code Here

        JSeparator separator = new JSeparator();

        getRootPane().setDefaultButton(buttonOk);

        GroupLayout gl = new GroupLayout(getRootPane());
        getRootPane().setLayout(gl);

        gl.setAutoCreateContainerGaps(true);
        gl.setAutoCreateGaps(true);

        gl.setHorizontalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(labelDescription, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
            .addGroup(gl.createSequentialGroup()
                .addComponent(true, textFieldPath, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
                .addComponent(buttonBrowse)
            )
            .addComponent(separator, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
            .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
                .addComponent(buttonOk)
                .addComponent(buttonCancel)
            )
        );

        gl.setVerticalGroup(gl.createSequentialGroup()
            .addComponent(labelDescription)
            .addGroup(gl.createParallelGroup()
                .addComponent(textFieldPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(buttonBrowse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            )
            .addComponent(separator, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addGroup(gl.createParallelGroup()
                .addComponent(buttonCancel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(buttonOk, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            )
        );
View Full Code Here

   
    JButton btnCancelar_1 = new JButton("Cancelar");
   
    this.separator = new JSeparator();
    this.separator.setOrientation(SwingConstants.VERTICAL);
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(
      gl_panel.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_panel.createSequentialGroup()
          .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup()
              .addContainerGap()
              .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
                .addComponent(lblNewLabel)
                .addComponent(lblApellidos)
                .addComponent(lblNewLabel_1)
                .addComponent(lblNewLabel_2)
                .addComponent(lblNewLabel_3)
                .addComponent(lblEquipo))
              .addGap(33)
              .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
                .addComponent(this.cbEquipo, GroupLayout.PREFERRED_SIZE, 187, GroupLayout.PREFERRED_SIZE)
                .addGroup(gl_panel.createParallelGroup(Alignment.TRAILING, false)
                  .addComponent(this.txtTelefono, Alignment.LEADING)
                  .addComponent(this.txtDireccion, Alignment.LEADING)
                  .addComponent(this.txtNombreJugador, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
                  .addComponent(this.txtApellidos, Alignment.LEADING)
                  .addComponent(this.txtFechaNacimiento, Alignment.LEADING))))
            .addGroup(gl_panel.createSequentialGroup()
              .addGap(53)
              .addComponent(btnInsertar_1)
              .addGap(18)
              .addComponent(btnCancelar_1)))
          .addGap(18)
          .addComponent(this.separator, GroupLayout.PREFERRED_SIZE, 16, GroupLayout.PREFERRED_SIZE)
          .addContainerGap(288, Short.MAX_VALUE))
    );
    gl_panel.setVerticalGroup(
      gl_panel.createParallelGroup(Alignment.TRAILING)
        .addGroup(gl_panel.createSequentialGroup()
          .addGap(26)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.txtNombreJugador, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblNewLabel))
          .addPreferredGap(ComponentPlacement.RELATED)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.txtApellidos, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblApellidos))
          .addPreferredGap(ComponentPlacement.RELATED)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.txtFechaNacimiento, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblNewLabel_1))
          .addPreferredGap(ComponentPlacement.RELATED)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.txtDireccion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblNewLabel_2))
          .addPreferredGap(ComponentPlacement.RELATED)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.txtTelefono, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblNewLabel_3))
          .addPreferredGap(ComponentPlacement.RELATED)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(this.cbEquipo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addComponent(lblEquipo))
          .addGap(34)
          .addGroup(gl_panel.createParallelGroup(Alignment.BASELINE)
            .addComponent(btnInsertar_1)
            .addComponent(btnCancelar_1))
          .addContainerGap(111, Short.MAX_VALUE))
        .addGroup(gl_panel.createSequentialGroup()
          .addContainerGap(15, Short.MAX_VALUE)
          .addComponent(this.separator, GroupLayout.PREFERRED_SIZE, 316, GroupLayout.PREFERRED_SIZE)
          .addGap(15))
    );
    panel.setLayout(gl_panel);
   
    JPanel panel_1 = new JPanel();
    tabbedPane.addTab("Equipos", null, panel_1, null);
   
    txtNombreEquipo = new JTextField();
    this.txtNombreEquipo.setEditable(false);
    txtNombreEquipo.setColumns(10);
   
    txtPatrocinador = new JTextField();
    this.txtPatrocinador.setEditable(false);
    txtPatrocinador.setColumns(10);
   
    txtColor1 = new JTextField();
    this.txtColor1.setEditable(false);
    txtColor1.setColumns(10);
   
    txtColor2 = new JTextField();
    this.txtColor2.setEditable(false);
    txtColor2.setColumns(10);
   
    txtCategoria = new JTextField();
    this.txtCategoria.setEditable(false);
    txtCategoria.setColumns(10);
   
    JLabel lblNombre = new JLabel("Nombre");
    lblNombre.setFont(new Font("Tahoma", Font.BOLD, 11));
   
    JLabel lblPatrocinador = new JLabel("Patrocinador");
   
    JLabel lblCamiseta = new JLabel("Camiseta 1");
   
    JLabel lblCamiseta_1 = new JLabel("Camiseta 2");
   
    JLabel lblCategora = new JLabel("Categor\u00EDa");
   
    btGuardarEquipo = new JButton("Guardar");
    this.btGuardarEquipo.setEnabled(false);
    btGuardarEquipo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        guardarEquipo();
      }
    });
   
    btCancelarEquipo = new JButton("Cancelar");
    this.btCancelarEquipo.setEnabled(false);
    btCancelarEquipo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        cancelarEquipo();
      }
    });
   
    this.separator_1 = new JSeparator();
    this.separator_1.setOrientation(SwingConstants.VERTICAL);
   
    this.scrollPane = new JScrollPane();
   
    this.btEliminarEquipo = new JButton("Eliminar");
    this.btEliminarEquipo.setEnabled(false);
    this.btEliminarEquipo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        eliminarEquipo();
      }
    });
   
    this.btModificarEquipo = new JButton("Modificar");
    this.btModificarEquipo.setEnabled(false);
    this.btModificarEquipo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        modificarEquipo();
      }
    });
   
    this.btNuevoEquipo = new JButton("Nuevo");
    this.btNuevoEquipo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        nuevoEquipo();
      }
    });
   
    this.txtFiltro = new JTextField();
    this.txtFiltro.addKeyListener(new KeyAdapter() {
      @Override
      public void keyTyped(KeyEvent arg0) {
        aplicarFiltroEquipo();
      }
    });
    this.txtFiltro.setColumns(10);
   
    this.btCancelarFiltro = new JButton("X");
    this.btCancelarFiltro.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        cancelarFiltroEquipo();
      }
    });
    GroupLayout gl_panel_1 = new GroupLayout(panel_1);
    gl_panel_1.setHorizontalGroup(
      gl_panel_1.createParallelGroup(Alignment.LEADING)
        .addGroup(gl_panel_1.createSequentialGroup()
          .addContainerGap()
          .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_1.createSequentialGroup()
              .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
                .addComponent(lblNombre)
                .addComponent(lblPatrocinador)
                .addComponent(lblCamiseta)
                .addComponent(lblCamiseta_1)
                .addComponent(lblCategora))
              .addGap(16)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
                .addComponent(this.txtCategoria, GroupLayout.PREFERRED_SIZE, 139, GroupLayout.PREFERRED_SIZE)
                .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING, false)
                  .addComponent(this.txtNombreEquipo, GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
                  .addComponent(this.txtPatrocinador)
                  .addComponent(this.txtColor1)
                  .addComponent(this.txtColor2))))
            .addGroup(gl_panel_1.createSequentialGroup()
              .addComponent(this.btNuevoEquipo)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(this.btGuardarEquipo)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(this.btCancelarEquipo)))
          .addGap(29)
          .addComponent(this.separator_1, GroupLayout.PREFERRED_SIZE, 8, GroupLayout.PREFERRED_SIZE)
          .addGap(18)
          .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_1.createParallelGroup(Alignment.TRAILING)
              .addComponent(this.scrollPane, GroupLayout.PREFERRED_SIZE, 312, GroupLayout.PREFERRED_SIZE)
              .addGroup(gl_panel_1.createSequentialGroup()
                .addComponent(this.btModificarEquipo)
                .addPreferredGap(ComponentPlacement.UNRELATED)
                .addComponent(this.btEliminarEquipo)))
            .addGroup(gl_panel_1.createSequentialGroup()
              .addComponent(this.txtFiltro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(this.btCancelarFiltro)))
          .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    );
    gl_panel_1.setVerticalGroup(
      gl_panel_1.createParallelGroup(Alignment.TRAILING)
        .addGroup(gl_panel_1.createSequentialGroup()
          .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addGroup(gl_panel_1.createParallelGroup(Alignment.LEADING)
            .addComponent(this.separator_1, GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE)
            .addGroup(gl_panel_1.createSequentialGroup()
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtNombreEquipo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(lblNombre))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtPatrocinador, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(lblPatrocinador))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtColor1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(lblCamiseta))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtColor2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(lblCamiseta_1))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtCategoria, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(lblCategora))
              .addGap(32)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.btCancelarEquipo)
                .addComponent(this.btGuardarEquipo)
                .addComponent(this.btNuevoEquipo)))
            .addGroup(gl_panel_1.createSequentialGroup()
              .addGap(11)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.txtFiltro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(this.btCancelarFiltro))
              .addPreferredGap(ComponentPlacement.RELATED)
              .addComponent(this.scrollPane, GroupLayout.PREFERRED_SIZE, 242, GroupLayout.PREFERRED_SIZE)
              .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
              .addGroup(gl_panel_1.createParallelGroup(Alignment.BASELINE)
                .addComponent(this.btEliminarEquipo)
                .addComponent(this.btModificarEquipo))))
          .addGap(11))
    );
   
View Full Code Here

        m_txtLength.addFocusListener(this);
        m_txtLength.setMaximumSize(maxControlSize);
        // Set walk length to default value

        // Now do the layout of the above labels and controls.
        GroupLayout layout = new GroupLayout(m_algorithmLeft);
        m_algorithmLeft.setLayout(layout);
        // Turn on automatically adding gaps between components
        layout.setAutoCreateGaps(true);
        // Turn on automatically creating gaps between components that touch
        // the edge of the container and the container.
        layout.setAutoCreateContainerGaps(true);
        // Create a sequential group for the horizontal axis.
        GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup();
        // The sequential group in turn contains two parallel groups.
        // One parallel group contains the labels, the other the controls.
        // Putting the labels in a parallel group along the horizontal axis
        // positions them at the same x location.
        hGroup.addGroup(layout.createParallelGroup().addComponent(labelAlgorithm).addComponent(labelTotalLength)
                        .addComponent(labelAverageLength));
        hGroup.addGroup(layout.createParallelGroup().addComponent(m_combAlgorithmSelection).addComponent(m_txtLength)
                        .addComponent(m_sliderAverageTestLength));
        layout.setHorizontalGroup(hGroup);

        // Create a sequential group for the vertical axis.
        GroupLayout.SequentialGroup vGroup = layout.createSequentialGroup();
        // The sequential group contains two parallel groups that align
        // the contents along the baseline. The first parallel group contains
        // the first label and control, and the second parallel group contains
        // the second label and control. By using a sequential group
        // the labels and text fields are positioned vertically after one another.
        vGroup.addGroup(layout.createParallelGroup(Alignment.CENTER).addComponent(labelAlgorithm).addComponent(
                        m_combAlgorithmSelection));
        vGroup.addGroup(layout.createParallelGroup(Alignment.CENTER).addComponent(labelTotalLength).addComponent(
                        m_txtLength));
        vGroup.addGroup(layout.createParallelGroup(Alignment.CENTER).addComponent(labelAverageLength).addComponent(
                        m_sliderAverageTestLength));
        layout.setVerticalGroup(vGroup);

        // The right hand side has all the algorithm-specific panels overlaid.
        m_algorithmRight = new JPanel();
        OverlayLayout overlay = new OverlayLayout(m_algorithmRight);
        m_algorithmRight.setLayout(overlay);
View Full Code Here

        JSeparator separator = new JSeparator();

        getRootPane().setDefaultButton(buttonOk);

        GroupLayout gl = new GroupLayout(getRootPane());
        getRootPane().setLayout(gl);

        gl.setAutoCreateContainerGaps(true);
        gl.setAutoCreateGaps(true);

        gl.setHorizontalGroup(gl.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addComponent(labelDescription, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
            .addGroup(gl.createSequentialGroup()
                .addComponent(true, textFieldPath, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
                .addComponent(buttonBrowse)
            )
            .addComponent(separator, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
            .addGroup(GroupLayout.Alignment.TRAILING, gl.createSequentialGroup()
                .addComponent(buttonOk)
                .addComponent(buttonCancel)
            )
        );

        gl.setVerticalGroup(gl.createSequentialGroup()
            .addComponent(labelDescription)
            .addGroup(gl.createParallelGroup()
                .addComponent(textFieldPath, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(buttonBrowse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            )
            .addComponent(separator, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addGroup(gl.createParallelGroup()
                .addComponent(buttonCancel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(buttonOk, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            )
        );
View Full Code Here

        return buttonsPanel;
    }

    private JPanel createGeneralPanel(ApplicationActionMap actionMap, ResourceMap resourceMap) {
        JPanel generalPanel = new JPanel();
        GroupLayout gl = new GroupLayout(generalPanel);
        generalPanel.setLayout(gl);
        gl.setAutoCreateGaps(true);
        gl.setAutoCreateContainerGaps(true);

        JLabel sdkPathLabel = new JLabel();
        sdkPathLabel.setName("sdkPathLabel");
        JButton setSdkPathButton = new JButton(actionMap.get(ACTION_SET_SDK_PATH));
        showLabelsInToolbarCheckBox = new JCheckBox();
        showLabelsInToolbarCheckBox.setName("showLabelsInToolbarCheckBox");
        sdkPathShowTextField = new JTextField();
        sdkPathShowTextField.setEditable(false);

        JLabel fsBackgroundLabel = new JLabel();
        fsBackgroundLabel.setName("fsBackgroundLabel");
        fsBackgroundPreview = new JPanel();
        fsBackgroundPreview.setBorder(new LineBorder(Color.GRAY));
        fsBackgroundPreview.setPreferredSize(new Dimension(20, 10));
        JButton fsBackgroundButton = new JButton(actionMap.get(ACTION_SET_FS_BACKGROUND));

        JButton browseButton = new JButton(actionMap.get(ACTION_SET_DEFAULT_FOLDER));
        JLabel folderLabel = new JLabel();
        folderLabel.setName("folderLabel");
        skipDuplicatesCheckBox = new JCheckBox();
        skipDuplicatesCheckBox.setName("skipDuplicatesCheckBox");
        saveOriginalCheckBox = new JCheckBox();
        saveOriginalCheckBox.setName("saveOriginalCheckBox");
        JLabel offsetLabel = new JLabel();
        offsetLabel.setName("offsetLabel");
        offsetSpinner = new JSpinner(new SpinnerNumberModel(0, 0, 100, 1));
        offsetSpinner.setName("offsetSpinner");
        savePathShowTextField = new JTextField();
        savePathShowTextField.setEditable(false);

        updateCheckBox = new JCheckBox();
        updateCheckBox.setName("updateCheckBox");

        gl.setHorizontalGroup(gl.createParallelGroup()
            .addComponent(sdkPathLabel)
            .addGroup(gl.createSequentialGroup()
                .addComponent(sdkPathShowTextField)
                .addComponent(setSdkPathButton)
                )
            .addComponent(folderLabel)
            .addGroup(gl.createSequentialGroup()
                .addComponent(savePathShowTextField)
                .addComponent(browseButton)
                )
            .addComponent(showLabelsInToolbarCheckBox)
            .addComponent(saveOriginalCheckBox)
            .addComponent(skipDuplicatesCheckBox)
            .addGroup(gl.createSequentialGroup()
                .addComponent(offsetLabel)
                .addComponent(offsetSpinner, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                )
            .addGroup(gl.createSequentialGroup()
                .addComponent(fsBackgroundLabel)
                .addComponent(fsBackgroundPreview)
                .addComponent(fsBackgroundButton)
                )
            );
        gl.setVerticalGroup(gl.createSequentialGroup()
            .addComponent(sdkPathLabel)
            .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(sdkPathShowTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(setSdkPathButton)
                )
            .addComponent(folderLabel)
            .addGroup(gl.createParallelGroup(GroupLayout.Alignment.BASELINE)
                .addComponent(savePathShowTextField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                .addComponent(browseButton)
                )
            .addComponent(showLabelsInToolbarCheckBox)
            .addComponent(saveOriginalCheckBox)
            .addComponent(skipDuplicatesCheckBox)
            .addGroup(gl.createBaselineGroup(false, true)
                .addComponent(offsetLabel)
                .addComponent(offsetSpinner)
                )
            .addGroup(gl.createBaselineGroup(false, true)
                .addComponent(fsBackgroundLabel)
                .addComponent(fsBackgroundPreview)
                .addComponent(fsBackgroundButton)
                )
            );
View Full Code Here

    textArea.setBorder(new LineBorder(Color.BLACK, 2));
    textArea.getDocument().addDocumentListener(this);

    JScrollPane jScrollPane1 = new JScrollPane(textArea);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);

    //Create a parallel group for the horizontal axis
    ParallelGroup hGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    //Create a sequential and a parallel groups
    SequentialGroup h1 = layout.createSequentialGroup();
    ParallelGroup h2 = layout.createParallelGroup(GroupLayout.Alignment.TRAILING);
    //Add a scroll panel and a label to the parallel group h2
    h2.addComponent(jScrollPane1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE);
    h2.addComponent(jLabel1, GroupLayout.Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 512, Short.MAX_VALUE);

    //Add a container gap to the sequential group h1
    h1.addContainerGap();
    // Add the group h2 to the group h1
    h1.addGroup(h2);
    h1.addContainerGap();
    //Add the group h1 to hGroup
    hGroup.addGroup(Alignment.TRAILING,h1);
    //Create the horizontal group
    layout.setHorizontalGroup(hGroup);

    //Create a parallel group for the vertical axis
    ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
    //Create a sequential group
    SequentialGroup v1 = layout.createSequentialGroup();
    //Add a container gap to the sequential group v1
    v1.addContainerGap();
    //Add a label to the sequential group v1
    v1.addComponent(jLabel1);
    v1.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
    //Add scroll panel to the sequential group v1
    v1.addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 500, Short.MAX_VALUE);
    v1.addContainerGap();
    //Add the group v1 to vGroup
    vGroup.addGroup(v1);
    //Create the vertical group
    layout.setVerticalGroup(vGroup);
    pack();
  }
View Full Code Here

/* 154 */     this.bntClear.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
/* 156 */         ClipTartView.this.bntClearActionPerformed(evt);
      }
    });
/* 160 */     GroupLayout mainPanelLayout = new GroupLayout(this.mainPanel);
/* 161 */     this.mainPanel.setLayout(mainPanelLayout);
/* 162 */     mainPanelLayout.setHorizontalGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup().addContainerGap().addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(this.jScrollPane1, GroupLayout.Alignment.LEADING, -1, 380, 32767).addGroup(mainPanelLayout.createSequentialGroup().addComponent(this.btnCopy).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.bntClear).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.btnHelp))).addContainerGap()));

/* 176 */     mainPanelLayout.setVerticalGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addContainerGap().addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.btnHelp).addComponent(this.btnCopy).addComponent(this.bntClear)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jScrollPane1, -1, 66, 32767).addContainerGap()));

/* 189 */     setComponent(this.mainPanel);
  }
View Full Code Here

TOP

Related Classes of javax.swing.GroupLayout$PreferredGapSpring

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.