Example usage for javax.swing GroupLayout createParallelGroup

List of usage examples for javax.swing GroupLayout createParallelGroup

Introduction

In this page you can find the example usage for javax.swing GroupLayout createParallelGroup.

Prototype

public ParallelGroup createParallelGroup() 

Source Link

Document

Creates and returns a ParallelGroup with an alignment of Alignment.LEADING .

Usage

From source file:com.fisher.mainFrame.java

private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - nick xu
    dialogPane = new JPanel();
    contentPanel = new JPanel();
    scrollPaneLogArea = new JScrollPane();
    logArea = new JTextArea();
    buttonBar = new JPanel();
    startButton = new JButton();
    stopButton = new JButton();

    //======== this ========
    setTitle("Fish Transform Trading");
    Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());

    //======== dialogPane ========
    {/*from  ww  w.j  av  a 2s . com*/
        dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
        dialogPane.setPreferredSize(new Dimension(758, 900));

        // JFormDesigner evaluation mark
        dialogPane.setBorder(new javax.swing.border.CompoundBorder(
                new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                        "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                        javax.swing.border.TitledBorder.BOTTOM,
                        new java.awt.Font("Dialog", java.awt.Font.BOLD, 12), java.awt.Color.red),
                dialogPane.getBorder()));
        dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent e) {
                if ("border".equals(e.getPropertyName()))
                    throw new RuntimeException();
            }
        });

        dialogPane.setLayout(new BorderLayout());

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

            //======== scrollPaneLogArea ========
            {
                scrollPaneLogArea.setViewportView(logArea);
            }

            GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
            contentPanel.setLayout(contentPanelLayout);
            contentPanelLayout.setHorizontalGroup(contentPanelLayout.createParallelGroup()
                    .addComponent(scrollPaneLogArea, GroupLayout.DEFAULT_SIZE, 734, Short.MAX_VALUE));
            contentPanelLayout
                    .setVerticalGroup(contentPanelLayout.createParallelGroup()
                            .addGroup(contentPanelLayout
                                    .createSequentialGroup().addComponent(scrollPaneLogArea,
                                            GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 476, Short.MAX_VALUE)));
        }
        dialogPane.add(contentPanel, BorderLayout.CENTER);

        //======== buttonBar ========
        {
            buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
            buttonBar.setLayout(new GridBagLayout());
            ((GridBagLayout) buttonBar.getLayout()).columnWidths = new int[] { 0, 85, 80 };
            ((GridBagLayout) buttonBar.getLayout()).columnWeights = new double[] { 1.0, 0.0, 0.0 };

            //---- startButton ----
            startButton.setText("Start");
            startButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    startButtonActionPerformed(e);
                }
            });
            buttonBar.add(startButton, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0));

            //---- stopButton ----
            stopButton.setText("Stop");
            stopButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    stopButtonActionPerformed(e);
                }
            });
            buttonBar.add(stopButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER,
                    GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
        }
        dialogPane.add(buttonBar, BorderLayout.SOUTH);
    }
    contentPane.add(dialogPane, BorderLayout.CENTER);
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}

From source file:com.employee.scheduler.nurserostering.swingui.NurseRosteringPanel.java

public NurseRosteringPanel() {
    employeeIcon = new ImageIcon(getClass().getResource("employee.png"));
    deleteEmployeeIcon = new ImageIcon(getClass().getResource("deleteEmployee.png"));
    GroupLayout layout = new GroupLayout(this);
    setLayout(layout);/*from w w w  . j  av  a  2 s.  co m*/
    createEmployeeListPanel();
    JPanel headerPanel = createHeaderPanel();
    layout.setHorizontalGroup(
            layout.createParallelGroup().addComponent(headerPanel).addComponent(employeeListPanel));
    layout.setVerticalGroup(layout.createSequentialGroup()
            .addComponent(headerPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addComponent(employeeListPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE,
                    GroupLayout.PREFERRED_SIZE));
}

From source file:FormularioGuardarEstudio.java

@SuppressWarnings({ "unchecked", "rawtypes" })
private void initComponents() {
    // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
    // Generated using JFormDesigner Evaluation license - verdura henrion
    label1 = new JLabel();
    pacientesCombo = new JComboBox(obtenerPacientes().toArray());
    label2 = new JLabel();
    label3 = new JLabel();
    label4 = new JLabel();
    label5 = new JLabel();
    nombreEstudio = new JTextField();
    scrollPane1 = new JScrollPane();
    descripcion = new JTextArea();
    descripcion.setLineWrap(true);/*from www . ja  v  a 2  s.  c om*/
    descripcion.setWrapStyleWord(true);
    notas = new JTextArea();
    notas.setLineWrap(true);
    notas.setWrapStyleWord(true);
    button1 = new JButton();
    mensajeRespuesta = new JLabel();

    //======== this ========
    setTitle("Guardar Estudio");
    Container contentPane = getContentPane();

    //---- label1 ----
    label1.setText("Paciente:");
    label1.setFont(new Font("Calibri", Font.BOLD, 14));

    //---- label2 ----
    label2.setText("Datos del Estudio");
    label2.setFont(new Font("Calibri", Font.BOLD, 14));

    //---- label3 ----
    label3.setText("Nombre Del Estudio:");

    //---- label4 ----
    label4.setText("Descripci\u00f3n:");

    //---- label5 ----
    label5.setText("Notas:");

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

    //---- button1 ----
    button1.setText("Guardar Estudio");
    button1.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            clickGuardarEstudio(e);
        }
    });

    //---- mensajeRespuesta ----
    mensajeRespuesta.setText("_");
    mensajeRespuesta.setHorizontalAlignment(SwingConstants.CENTER);

    GroupLayout contentPaneLayout = new GroupLayout(contentPane);
    contentPane.setLayout(contentPaneLayout);
    contentPaneLayout.setHorizontalGroup(contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout
            .createSequentialGroup()
            .addGroup(contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout.createSequentialGroup()
                    .addContainerGap().addGroup(contentPaneLayout.createParallelGroup().addComponent(label4)
                            .addComponent(label1, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                    pacientesCombo, GroupLayout.PREFERRED_SIZE, 73, GroupLayout.PREFERRED_SIZE)
                            .addComponent(label2)
                            .addGroup(contentPaneLayout.createSequentialGroup().addComponent(label3)
                                    .addGap(18, 18, 18).addComponent(nombreEstudio, GroupLayout.PREFERRED_SIZE,
                                            140, GroupLayout.PREFERRED_SIZE))
                            .addGroup(contentPaneLayout.createSequentialGroup().addComponent(label5)
                                    .addGroup(contentPaneLayout.createParallelGroup().addGroup(contentPaneLayout
                                            .createSequentialGroup().addGap(83, 83, 83)
                                            .addGroup(contentPaneLayout
                                                    .createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                                    .addComponent(scrollPane1, GroupLayout.DEFAULT_SIZE, 256,
                                                            Short.MAX_VALUE)
                                                    .addComponent(notas, GroupLayout.DEFAULT_SIZE, 256,
                                                            Short.MAX_VALUE)))
                                            .addGroup(contentPaneLayout.createSequentialGroup()
                                                    .addGap(48, 48, 48).addComponent(mensajeRespuesta,
                                                            GroupLayout.PREFERRED_SIZE, 215,
                                                            GroupLayout.PREFERRED_SIZE))))))
                    .addGroup(contentPaneLayout.createSequentialGroup().addGap(142, 142, 142)
                            .addComponent(button1)))
            .addContainerGap(18, Short.MAX_VALUE)));
    contentPaneLayout.setVerticalGroup(contentPaneLayout.createParallelGroup()
            .addGroup(contentPaneLayout.createSequentialGroup().addContainerGap()
                    .addComponent(label1, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(pacientesCombo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18).addComponent(label2).addGap(18, 18, 18)
                    .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(label3).addComponent(nombreEstudio, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(contentPaneLayout.createParallelGroup().addComponent(label4).addComponent(
                            scrollPane1, GroupLayout.PREFERRED_SIZE, 78, GroupLayout.PREFERRED_SIZE))
                    .addGap(11, 11, 11)
                    .addGroup(contentPaneLayout.createParallelGroup().addComponent(label5).addComponent(notas,
                            GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(mensajeRespuesta, GroupLayout.DEFAULT_SIZE, 17, Short.MAX_VALUE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(button1)
                    .addContainerGap()));
    pack();
    setLocationRelativeTo(getOwner());
    // JFormDesigner - End of component initialization  //GEN-END:initComponents
}