Example usage for javax.swing JPanel setToolTipText

List of usage examples for javax.swing JPanel setToolTipText

Introduction

In this page you can find the example usage for javax.swing JPanel setToolTipText.

Prototype

@BeanProperty(bound = false, preferred = true, description = "The text to display in a tool tip.")
public void setToolTipText(String text) 

Source Link

Document

Registers the text to display in a tool tip.

Usage

From source file:com.devoteam.srit.xmlloader.core.report.derived.StatFlow.java

@Override
public JPanel generateShortRTStats() {
    JPanel panel = new JPanel();
    panel.setLayout(new javax.swing.BoxLayout(panel, javax.swing.BoxLayout.Y_AXIS));

    panel.add(new JLabel(Utils.formatdouble(this.counter.globalDataset.getValue())));
    panel.add(new JLabel(
            Utils.formatdouble((this.counter.globalDataset.getValue() * 1000 / this.reportEndTimestamp))
                    + "/s"));

    panel.setToolTipText(generateRTStatsToolTip());

    addMouseListenerForGraph(panel);/*from   w  ww . ja  v  a  2  s .  c o  m*/

    return panel;
}

From source file:com.juanhg.pattern.PatternApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblO1 = new JLabel("O1:");
    lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO1Value = new JLabel();
    lblO1Value.setText("0");
    lblO1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblO2 = new JLabel("O2:");
    lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO2Value = new JLabel();
    lblO2Value.setText("0");
    lblO2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO3 = new JLabel("O3:");
    lblO3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO3Value = new JLabel();
    lblO3Value.setText("0");
    lblO3Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22).addGroup(gl_panelOutputs
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 84, GroupLayout.PREFERRED_SIZE)
                            .addGap(26)/*w w  w .  j  a  v a2s  .c  o  m*/
                            .addComponent(lblO3Value, GroupLayout.DEFAULT_SIZE, 103, Short.MAX_VALUE))
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblO1, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGap(26))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 81,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(29)))
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblO2Value, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lblO1Value, GroupLayout.PREFERRED_SIZE, 103,
                                            GroupLayout.PREFERRED_SIZE))))
                    .addGap(109)));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblO1Value).addComponent(lblO1))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblO2Value, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblO3Value, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(79)));
    panelOutputs.setLayout(gl_panelOutputs);

    JPanel panelLicense = new JPanel();
    panelLicense.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control
                    .createParallelGroup(Alignment.LEADING)
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                    .addComponent(panelOutputs, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panel_6, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                    .addComponent(panelLicense, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 213, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 129, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 146, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(24)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING,
            gl_panel_6.createSequentialGroup().addContainerGap()
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                    .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING,
            gl_panel_6.createSequentialGroup().addGap(80)
                    .addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 55,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panelLicense.add(lblNewLabel);

    JLabel LabelI1 = new JLabel("I1");
    LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI2 = new JLabel("I2");
    labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI3 = new JLabel("I3");
    labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblI2Value = new JLabel("5");
    lblI2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblI3Value = new JLabel("5");
    lblI3Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblI1Value = new JLabel("5");
    lblI1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderI1 = new JSlider();
    sliderI1.setMaximum(10);
    sliderI1.setMinorTickSpacing(1);
    sliderI1.setValue(5);
    sliderI1.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

    sliderI2 = new JSlider();
    sliderI2.setMaximum(10);
    sliderI2.setMinorTickSpacing(1);
    sliderI2.setValue(5);
    sliderI2.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI2Event();
        }
    });

    sliderI3 = new JSlider();
    sliderI3.setMaximum(10);
    sliderI3.setValue(5);
    sliderI3.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

    JLabel lblI4 = new JLabel("I4");
    lblI4.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblI4Value = new JLabel("5");
    lblI4Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderI4 = new JSlider();
    sliderI4.setMaximum(10);
    sliderI4.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI4Event();
        }
    });
    sliderI4.setValue(5);
    sliderI4.setMinorTickSpacing(1);

    JLabel lblI5 = new JLabel("I5");
    lblI5.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblI5Value = new JLabel("5");
    lblI5Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderI5 = new JSlider();
    sliderI5.setMaximum(10);
    sliderI5.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI5Event();
        }
    });
    sliderI5.setValue(5);
    sliderI5.setMinorTickSpacing(1);

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(labelI3, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(LabelI1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(labelI2, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 120,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(18)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblI1Value, GroupLayout.PREFERRED_SIZE, 42,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblI2Value, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblI3Value, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(18)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(sliderI1, 0, 0, Short.MAX_VALUE)
                                    .addComponent(sliderI2, 0, 0, Short.MAX_VALUE).addComponent(
                                            sliderI3, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE)))
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(lblI4Value, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(sliderI4, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE))
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addComponent(lblI5, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(lblI5Value, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(18).addComponent(sliderI5, GroupLayout.PREFERRED_SIZE, 88,
                                    GroupLayout.PREFERRED_SIZE)))
                    .addGap(19))
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 352, Short.MAX_VALUE));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(LabelI1).addComponent(lblI1Value, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderI1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelI2).addComponent(lblI2Value, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderI2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3)
                            .addComponent(lblI3Value, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderI3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblI4Value, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderI4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblI5, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblI5Value, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderI5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(429)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout
            .createSequentialGroup()
            .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
                    .addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(panel_control,
                            GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE))
                    .addGroup(groupLayout.createSequentialGroup().addGap(12).addComponent(panel_visualizar,
                            GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE)))
            .addContainerGap()));
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(
            gl_panel_visualizar.createParallelGroup(Alignment.LEADING).addGap(0, 845, Short.MAX_VALUE));
    gl_panel_visualizar.setVerticalGroup(
            gl_panel_visualizar.createParallelGroup(Alignment.LEADING).addGap(0, 567, Short.MAX_VALUE));

    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:com.juanhg.triangle.TriangleApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblO1 = new JLabel("Tensi\u00F3n:");
    lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTValue = new JLabel();
    lblTValue.setText("0");
    lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblO2 = new JLabel("V:");
    lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVValue = new JLabel();
    lblVValue.setText("0");
    lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO3 = new JLabel("tfinal:");
    lblO3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTfValue = new JLabel();
    lblTfValue.setText("0");
    lblTfValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblW = new JLabel("W:");
    lblW.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblWValue = new JLabel();
    lblWValue.setText("0");
    lblWValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(lblO2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(lblO1, GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(lblVValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(lblTValue, GroupLayout.DEFAULT_SIZE, 72, Short.MAX_VALUE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblO3, GroupLayout.DEFAULT_SIZE, 45, Short.MAX_VALUE)
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addComponent(lblTfValue, GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE))
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 45,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblWValue,
                                            GroupLayout.PREFERRED_SIZE, 115, GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    gl_panelOutputs//from w w  w  .ja  v  a 2  s. c  o m
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblO1)
                                            .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblO2,
                                                    GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(lblTValue)
                                                    .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(
                                                            lblTfValue, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE))
                                            .addPreferredGap(ComponentPlacement.UNRELATED)
                                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                                    .addGroup(gl_panelOutputs
                                                            .createParallelGroup(Alignment.BASELINE)
                                                            .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 17,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(lblWValue, GroupLayout.PREFERRED_SIZE,
                                                                    17, GroupLayout.PREFERRED_SIZE))
                                                    .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE))))
                            .addGap(107)));
    panelOutputs.setLayout(gl_panelOutputs);

    JPanel panelLicense = new JPanel();
    panelLicense.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control
                    .createParallelGroup(Alignment.LEADING)
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                    .addComponent(panel_6, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                    .addComponent(panelLicense, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE).addComponent(
                            panelOutputs, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 105, GroupLayout.PREFERRED_SIZE)
                    .addGap(13)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 85, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(24)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6.createSequentialGroup().addContainerGap()
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                    .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6
                    .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation,
                            GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(69, Short.MAX_VALUE)));
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panelLicense.add(lblNewLabel);

    JLabel LabelI1 = new JLabel("Roz Est\u00E1tico");
    LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI2 = new JLabel("Roz Din\u00E1mico");
    labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI3 = new JLabel("Masa");
    labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblMudValue = new JLabel("0.1");
    lblMudValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblMValue = new JLabel("10");
    lblMValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblMueValue = new JLabel("0.4");
    lblMueValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderMue = new JSlider();
    sliderMue.setMinimum(15);
    sliderMue.setMaximum(80);
    sliderMue.setMinorTickSpacing(1);
    sliderMue.setValue(40);
    sliderMue.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

    sliderMud = new JSlider();
    sliderMud.setMinimum(5);
    sliderMud.setMaximum(15);
    sliderMud.setMinorTickSpacing(1);
    sliderMud.setValue(10);
    sliderMud.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI2Event();
        }
    });

    sliderIM = new JSlider();
    sliderIM.setMinimum(1);
    sliderIM.setMaximum(20);
    sliderIM.setValue(10);
    sliderIM.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

    JLabel lblI4 = new JLabel("\u00C1ngulo");
    lblI4.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblZValue = new JLabel("45\u00BA");
    lblZValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderZ = new JSlider();
    sliderZ.setMinimum(20);
    sliderZ.setMaximum(60);
    sliderZ.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI4Event();
        }
    });
    sliderZ.setValue(45);
    sliderZ.setMinorTickSpacing(1);

    btnCilindro = new JButton(new ImageIcon(loadImage(cilindro)));
    btnCilindro.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            type = CILINDRO;
            btnCilindro.setEnabled(false);
            btnEsfera.setEnabled(true);
            btnCubo.setEnabled(true);

            chartTriangle.deleteAnnotation(pulleyAnnotation);
            pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage1, xPulley, yPulley);

            updatePanels();
            repaint();
        }
    });

    btnEsfera = new JButton(new ImageIcon(loadImage(esfera)));
    btnEsfera.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            type = ESFERA;
            btnCilindro.setEnabled(true);
            btnEsfera.setEnabled(false);
            btnCubo.setEnabled(true);

            chartTriangle.deleteAnnotation(pulleyAnnotation);
            pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage2, xPulley, yPulley);

            updatePanels();
            repaint();
        }
    });

    btnCubo = new JButton(new ImageIcon(loadImage(cubo)));
    btnCubo.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            type = CUBO;
            btnCilindro.setEnabled(true);
            btnEsfera.setEnabled(true);
            btnCubo.setEnabled(false);

            chartTriangle.deleteAnnotation(pulleyAnnotation);
            pulleyAnnotation = chartTriangle.setImageAtPoint(pulleyImage3, xPulley, yPulley);

            updatePanels();
            repaint();
        }
    });

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
            .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                    .createParallelGroup(Alignment.LEADING).addGroup(gl_panelInputs.createSequentialGroup()
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(labelI3, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(LabelI1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(labelI2, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 120,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(18)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblMueValue, GroupLayout.PREFERRED_SIZE, 42,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblMudValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 56,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(18)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(sliderMue, 0, 0, Short.MAX_VALUE)
                                    .addComponent(sliderMud, 0, 0, Short.MAX_VALUE).addComponent(
                                            sliderIM, GroupLayout.PREFERRED_SIZE, 88,
                                            GroupLayout.PREFERRED_SIZE)))
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 120, GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(lblZValue, GroupLayout.PREFERRED_SIZE, 56, GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(sliderZ, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)))
                    .addGap(19))
            .addGroup(Alignment.LEADING, gl_panelInputs.createSequentialGroup().addGap(35)
                    .addComponent(btnCilindro, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addComponent(btnEsfera, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addComponent(btnCubo, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(42, Short.MAX_VALUE)));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(LabelI1).addComponent(lblMueValue, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderMue, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelI2).addComponent(lblMudValue, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderMud, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3)
                            .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderIM, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblZValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderZ, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(36)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                            .addComponent(btnCubo, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnEsfera, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnCilindro, GroupLayout.PREFERRED_SIZE, 61,
                                    GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 696, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(149, Short.MAX_VALUE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(panel_visualizar, Alignment.TRAILING, 0, 0, Short.MAX_VALUE)
                            .addComponent(panel_control, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 568,
                                    Short.MAX_VALUE))
                    .addContainerGap()));

    JPanel panel = new JPanel();

    panelGrafica = new JPanelGrafica();
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelGrafica,
            GroupLayout.DEFAULT_SIZE, 686, Short.MAX_VALUE));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addComponent(panelGrafica,
            GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE));
    panel.setLayout(gl_panel);
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 414, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(272, Short.MAX_VALUE)));
    gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addComponent(panel, GroupLayout.DEFAULT_SIZE, 546, Short.MAX_VALUE).addContainerGap()));

    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:cool.pandora.modeller.ui.jpanel.base.SaveBagFrame.java

private JPanel createComponents() {
    final Border border = new EmptyBorder(5, 5, 5, 5);

    final TitlePane titlePane = new TitlePane();
    initStandardCommands();//from   w  w  w .j  a  va 2s.  c o m
    final JPanel pageControl = new JPanel(new BorderLayout());
    final JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("SaveBagFrame.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Define the Bag " + "settings")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);
    final JPanel contentPane = new JPanel();

    // TODO: Add bag name field
    // TODO: Add save name file selection button
    final JLabel location = new JLabel("Save in:");
    final JButton browseButton = new JButton(getMessage("bag.button.browse"));
    browseButton.addActionListener(new SaveBagAsHandler());
    browseButton.setEnabled(true);
    browseButton.setToolTipText(getMessage("bag.button.browse.help"));
    final DefaultBag bag = bagView.getBag();
    if (bag != null) {
        bagNameField = new JTextField(bag.getName());
        bagNameField.setCaretPosition(bag.getName().length());
        bagNameField.setEditable(false);
        bagNameField.setEnabled(false);
    }

    // Holey bag control
    final JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey"));
    holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));
    final JCheckBox holeyCheckbox = new JCheckBox(bagView.getPropertyMessage("bag.checkbox" + ".isholey"));
    holeyCheckbox.setBorder(border);
    holeyCheckbox.addActionListener(new HoleyBagHandler());
    holeyCheckbox.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));

    urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label"));
    urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description"));
    urlField = new JTextField("");
    try {
        assert bag != null;
        urlField.setText(bag.getFetch().getBaseURL());
    } catch (Exception e) {
        log.error("Failed to set url label", e);
    }
    urlField.setEnabled(false);

    // TODO: Add format label
    final JLabel serializeLabel;
    serializeLabel = new JLabel(getMessage("bag.label.ispackage"));
    serializeLabel.setToolTipText(getMessage("bag.serializetype.help"));

    // TODO: Add format selection panel
    noneButton = new JRadioButton(getMessage("bag.serializetype.none"));
    noneButton.setEnabled(true);
    final AbstractAction serializeListener = new SerializeBagHandler();
    noneButton.addActionListener(serializeListener);
    noneButton.setToolTipText(getMessage("bag.serializetype.none.help"));

    zipButton = new JRadioButton(getMessage("bag.serializetype.zip"));
    zipButton.setEnabled(true);
    zipButton.addActionListener(serializeListener);
    zipButton.setToolTipText(getMessage("bag.serializetype.zip.help"));

    /*
     * tarButton = new JRadioButton(getMessage("bag.serializetype.tar"));
     * tarButton.setEnabled(true);
     * tarButton.addActionListener(serializeListener);
     * tarButton.setToolTipText(getMessage("bag.serializetype.tar.help"));
     *
     * tarGzButton = new JRadioButton(getMessage("bag.serializetype.targz"));
     * tarGzButton.setEnabled(true);
     * tarGzButton.addActionListener(serializeListener);
     * tarGzButton.setToolTipText(getMessage("bag.serializetype.targz.help"));
     *
     * tarBz2Button = new JRadioButton(getMessage("bag.serializetype.tarbz2"));
     * tarBz2Button.setEnabled(true);
     * tarBz2Button.addActionListener(serializeListener);
     * tarBz2Button.setToolTipText(getMessage("bag.serializetype.tarbz2.help"));
     */

    short mode = 2;
    if (bag != null) {
        mode = bag.getSerialMode();
    }
    if (mode == DefaultBag.NO_MODE) {
        this.noneButton.setEnabled(true);
    } else if (mode == DefaultBag.ZIP_MODE) {
        this.zipButton.setEnabled(true);
    } else {
        this.noneButton.setEnabled(true);
    }

    final ButtonGroup serializeGroup = new ButtonGroup();
    serializeGroup.add(noneButton);
    serializeGroup.add(zipButton);
    // serializeGroup.add(tarButton);
    // serializeGroup.add(tarGzButton);
    // serializeGroup.add(tarBz2Button);
    final JPanel serializeGroupPanel = new JPanel(new FlowLayout());
    serializeGroupPanel.add(serializeLabel);
    serializeGroupPanel.add(noneButton);
    serializeGroupPanel.add(zipButton);
    // serializeGroupPanel.add(tarButton);
    // serializeGroupPanel.add(tarGzButton);
    // serializeGroupPanel.add(tarBz2Button);
    serializeGroupPanel.setBorder(border);
    serializeGroupPanel.setEnabled(true);
    serializeGroupPanel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help"));

    final JLabel tagLabel = new JLabel(getMessage("bag.label.istag"));
    tagLabel.setToolTipText(getMessage("bag.label.istag.help"));
    final JCheckBox isTagCheckbox = new JCheckBox();
    isTagCheckbox.setBorder(border);
    isTagCheckbox.addActionListener(new TagManifestHandler());
    isTagCheckbox.setToolTipText(getMessage("bag.checkbox.istag.help"));

    final JLabel tagAlgorithmLabel = new JLabel(getMessage("bag.label.tagalgorithm"));
    tagAlgorithmLabel.setToolTipText(getMessage("bag.label.tagalgorithm.help"));
    final ArrayList<String> listModel = new ArrayList<>();
    for (final Algorithm algorithm : Algorithm.values()) {
        listModel.add(algorithm.bagItAlgorithm);
    }
    final JComboBox<String> tagAlgorithmList = new JComboBox<>(listModel.toArray(new String[listModel.size()]));
    tagAlgorithmList.setName(getMessage("bag.tagalgorithmlist"));
    tagAlgorithmList.addActionListener(new TagAlgorithmListHandler());
    tagAlgorithmList.setToolTipText(getMessage("bag.tagalgorithmlist.help"));

    final JLabel payloadLabel = new JLabel(getMessage("bag.label.ispayload"));
    payloadLabel.setToolTipText(getMessage("bag.ispayload.help"));
    final JCheckBox isPayloadCheckbox = new JCheckBox();
    isPayloadCheckbox.setBorder(border);
    isPayloadCheckbox.addActionListener(new PayloadManifestHandler());
    isPayloadCheckbox.setToolTipText(getMessage("bag.ispayload.help"));

    final JLabel payAlgorithmLabel = new JLabel(bagView.getPropertyMessage("bag.label" + ".payalgorithm"));
    payAlgorithmLabel.setToolTipText(getMessage("bag.payalgorithm.help"));
    final JComboBox<String> payAlgorithmList = new JComboBox<String>(
            listModel.toArray(new String[listModel.size()]));
    payAlgorithmList.setName(getMessage("bag.payalgorithmlist"));
    payAlgorithmList.addActionListener(new PayAlgorithmListHandler());
    payAlgorithmList.setToolTipText(getMessage("bag.payalgorithmlist.help"));

    //only if bag is not null
    if (bag != null) {
        final String fileName = bag.getName();
        bagNameField = new JTextField(fileName);
        bagNameField.setCaretPosition(fileName.length());

        holeyCheckbox.setSelected(bag.isHoley());
        urlLabel.setEnabled(bag.isHoley());
        isTagCheckbox.setSelected(bag.isBuildTagManifest());
        tagAlgorithmList.setSelectedItem(bag.getTagManifestAlgorithm());
        isPayloadCheckbox.setSelected(bag.isBuildPayloadManifest());
        payAlgorithmList.setSelectedItem(bag.getPayloadManifestAlgorithm());
    }

    final GridBagLayout layout = new GridBagLayout();
    final GridBagConstraints glbc = new GridBagConstraints();
    final JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;

    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(location, glbc);
    panel.add(location);

    buildConstraints(glbc, 2, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.EAST);
    glbc.ipadx = 5;
    layout.setConstraints(browseButton, glbc);
    glbc.ipadx = 0;
    panel.add(browseButton);

    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    glbc.ipadx = 5;
    layout.setConstraints(bagNameField, glbc);
    glbc.ipadx = 0;
    panel.add(bagNameField);

    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(holeyLabel, glbc);
    panel.add(holeyLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.WEST, GridBagConstraints.WEST);
    layout.setConstraints(holeyCheckbox, glbc);
    panel.add(holeyCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(urlLabel, glbc);
    panel.add(urlLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(urlField, glbc);
    panel.add(urlField);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(serializeLabel, glbc);
    panel.add(serializeLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    layout.setConstraints(serializeGroupPanel, glbc);
    panel.add(serializeGroupPanel);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagLabel, glbc);
    panel.add(tagLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isTagCheckbox, glbc);
    panel.add(isTagCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagAlgorithmLabel, glbc);
    panel.add(tagAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(tagAlgorithmList, glbc);
    panel.add(tagAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payloadLabel, glbc);
    panel.add(payloadLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isPayloadCheckbox, glbc);
    panel.add(isPayloadCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payAlgorithmLabel, glbc);
    panel.add(payAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(payAlgorithmList, glbc);
    panel.add(payAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GuiStandardUtils.attachDialogBorder(contentPane);
    pageControl.add(panel);
    final JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}

From source file:com.juanhg.icewalker.IceWalkerApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTiempo = new JPanel();
    panelTiempo.setToolTipText("");
    panelTiempo.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblPhase = new JLabel("Velocidad:");
    lblPhase.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVValue = new JLabel();
    lblVValue.setText("0");
    lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblPosicion = new JLabel("Posici\u00F3n:");
    lblPosicion.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblPositionValue = new JLabel();
    lblPositionValue.setText("0");
    lblPositionValue.setFont(new Font("Tahoma", Font.PLAIN, 14));
    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs//  ww  w  .j  a v  a2  s  .  co  m
            .setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
                    .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap()
                            .addComponent(lblPhase, GroupLayout.DEFAULT_SIZE, 81, Short.MAX_VALUE).addGap(26)
                            .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 147,
                                    GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(130, Short.MAX_VALUE))
                    .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap()
                            .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 81,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(26).addComponent(lblPositionValue, GroupLayout.PREFERRED_SIZE, 147,
                                    GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(130, Short.MAX_VALUE)));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblPhase).addComponent(lblVValue))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblPosicion, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblPositionValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(63)));
    panelOutputs.setLayout(gl_panelOutputs);

    panel_1 = new JPanel();
    panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panel_control.createSequentialGroup()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(panelOutputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(panelInputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addContainerGap())
                    .addGroup(Alignment.TRAILING, gl_panel_control.createSequentialGroup()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(panel_1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 404,
                                            Short.MAX_VALUE)
                                    .addComponent(panelTiempo, GroupLayout.DEFAULT_SIZE, 404, Short.MAX_VALUE))
                            .addContainerGap()))));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 141, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelTiempo, GroupLayout.PREFERRED_SIZE, 271, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED, 15, Short.MAX_VALUE).addComponent(panel_1,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panel_1.add(lblNewLabel);

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });

    panel = new JPanel();
    panel.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    label = new JLabel("Datos de la Simulaci\u00F3n");
    label.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel.add(label);

    btnBanana = new JButton("");
    btnBanana.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnBananaEvent();
        }
    });
    bananaImage = loadImage(banana);
    btnBanana.setIcon(new ImageIcon(bananaImage));

    btnBurger = new JButton("");
    btnBurger.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnBurgerEvent();
        }
    });
    burgerImage = loadImage(burger);
    btnBurger.setIcon(new ImageIcon(burgerImage));

    btnCookie = new JButton("");
    btnCookie.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnCookieEvent();
        }
    });
    cookieImage = loadImage(cookie);
    btnCookie.setIcon(new ImageIcon(cookieImage));

    btnCarrot = new JButton("");
    carrotImage = loadImage(carrot);
    btnCarrot.setIcon(new ImageIcon(carrotImage));
    btnCarrot.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnCarrotEvent();
        }
    });

    JLabel lblNewLabel_1 = new JLabel("30 cal/100g");

    JLabel lblCalg_2 = new JLabel("734 cal/100g");

    lblCalg = new JLabel("90 cal/100g");

    lblCalg_1 = new JLabel("433 cal/100g");

    GroupLayout gl_panelTiempo = new GroupLayout(panelTiempo);
    gl_panelTiempo.setHorizontalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 402, Short.MAX_VALUE)
            .addGroup(gl_panelTiempo.createSequentialGroup().addGap(17).addGroup(gl_panelTiempo
                    .createParallelGroup(Alignment.LEADING, false)
                    .addComponent(btnLaunchSimulation, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(gl_panelTiempo.createSequentialGroup()
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(btnCarrot, GroupLayout.PREFERRED_SIZE, 81,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblNewLabel_1, GroupLayout.PREFERRED_SIZE, 72,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(btnBanana).addComponent(lblCalg, GroupLayout.PREFERRED_SIZE,
                                            72, GroupLayout.PREFERRED_SIZE))
                            .addGap(18)
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(btnCookie, GroupLayout.PREFERRED_SIZE, 81,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblCalg_1, GroupLayout.PREFERRED_SIZE, 72,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelTiempo.createSequentialGroup().addGap(6).addComponent(
                                            btnBurger, GroupLayout.PREFERRED_SIZE, 81,
                                            GroupLayout.PREFERRED_SIZE))
                                    .addGroup(gl_panelTiempo.createSequentialGroup().addGap(18).addComponent(
                                            lblCalg_2, GroupLayout.PREFERRED_SIZE, 72,
                                            GroupLayout.PREFERRED_SIZE)))))
                    .addContainerGap(24, Short.MAX_VALUE)));
    gl_panelTiempo.setVerticalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelTiempo.createSequentialGroup()
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING).addGroup(gl_panelTiempo
                            .createSequentialGroup()
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
                                    .addComponent(btnCarrot, GroupLayout.PREFERRED_SIZE, 69,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnCookie, GroupLayout.PREFERRED_SIZE, 69,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnBurger, GroupLayout.PREFERRED_SIZE, 69,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblNewLabel_1, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(lblCalg_2, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(lblCalg_1, GroupLayout.DEFAULT_SIZE, 27,
                                                    Short.MAX_VALUE))
                                    .addComponent(lblCalg, GroupLayout.DEFAULT_SIZE, 27, Short.MAX_VALUE)))
                            .addComponent(btnBanana, GroupLayout.PREFERRED_SIZE, 69,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(30).addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 62,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(33, Short.MAX_VALUE)));
    panelTiempo.setLayout(gl_panelTiempo);

    JLabel LabelStrength = new JLabel("Fuerza");
    LabelStrength.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelStaticFriction = new JLabel("Roz. Est\u00E1tico");
    labelStaticFriction.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelDynamicFriction = new JLabel("Roz. Din\u00E1mico");
    labelDynamicFriction.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblStaticFrictionValue = new JLabel("0.2");
    lblStaticFrictionValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblDynamicFrictionValue = new JLabel("0.1");
    lblDynamicFrictionValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblStregthValue = new JLabel("100");
    lblStregthValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderStrength = new JSlider();
    sliderStrength.setMinorTickSpacing(1);
    sliderStrength.setMinimum(1);
    sliderStrength.setMaximum(300);
    sliderStrength.setValue(100);
    sliderStrength.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderStrenghtEvent();
        }
    });

    sliderStaticFriction = new JSlider();
    sliderStaticFriction.setMinimum(15);
    sliderStaticFriction.setMaximum(80);
    sliderStaticFriction.setMinorTickSpacing(1);
    sliderStaticFriction.setValue(20);
    sliderStaticFriction.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderStaticFrictionEvent();
        }
    });

    sliderDynamicFriction = new JSlider();
    sliderDynamicFriction.setValue(10);
    sliderDynamicFriction.setMaximum(15);
    sliderDynamicFriction.setMinimum(5);
    sliderDynamicFriction.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderDynamicFrictionEvent();
        }
    });
    sliderDynamicFriction.setMinorTickSpacing(1);

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                            .addComponent(labelDynamicFriction, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(LabelStrength, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(labelStaticFriction, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                    120, Short.MAX_VALUE))
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblStregthValue, GroupLayout.PREFERRED_SIZE, 42,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblStaticFrictionValue, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblDynamicFrictionValue, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(sliderStaticFriction, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderStrength, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderDynamicFriction, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(26))
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE));
    gl_panelInputs
            .setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(8)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(LabelStrength).addComponent(lblStregthValue,
                                                    GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                                    .addComponent(sliderStrength, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(labelStaticFriction)
                                            .addComponent(lblStaticFrictionValue, GroupLayout.PREFERRED_SIZE,
                                                    17, GroupLayout.PREFERRED_SIZE))
                                    .addComponent(sliderStaticFriction, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addGap(11)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(labelDynamicFriction)
                                    .addComponent(lblDynamicFrictionValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(sliderDynamicFriction, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                            .addGap(75)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 432, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_visualizar, GroupLayout.DEFAULT_SIZE, 592, Short.MAX_VALUE)
                    .addContainerGap()));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                            .addComponent(panel_visualizar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 598,
                                    Short.MAX_VALUE)
                            .addComponent(panel_control, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 598,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    GridBagLayout gbl_panel_visualizar = new GridBagLayout();
    gbl_panel_visualizar.columnWidths = new int[] { 0, 0 };
    gbl_panel_visualizar.rowHeights = new int[] { 0, 0, 0 };
    gbl_panel_visualizar.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl_panel_visualizar.rowWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
    panel_visualizar.setLayout(gbl_panel_visualizar);

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    GridBagConstraints gbc_tabbedPane = new GridBagConstraints();
    gbc_tabbedPane.gridheight = 2;
    gbc_tabbedPane.fill = GridBagConstraints.BOTH;
    gbc_tabbedPane.gridx = 0;
    gbc_tabbedPane.gridy = 0;
    panel_visualizar.add(tabbedPane, gbc_tabbedPane);

    panelSimulation = new JPanelGrafica();
    tabbedPane.addTab("Simulacin", null, panelSimulation, null);
    panelSimulation.setBackground(Color.WHITE);

    getContentPane().setLayout(groupLayout);
}

From source file:com.juanhg.fridge.FridgeApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblO1 = new JLabel("Tiempo On:");
    lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTValue = new JLabel();
    lblTValue.setText("0");
    lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblO2 = new JLabel("Eficiencia:");
    lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblEValue = new JLabel();
    lblEValue.setText("0");
    lblEValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblTiempoOff = new JLabel("Tiempo Off:");
    lblTiempoOff.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblOffValue = new JLabel();
    lblOffValue.setText("0");
    lblOffValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 81, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblO1, GroupLayout.PREFERRED_SIZE, 77, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 65, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 52,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(31)
                                    .addComponent(lblTiempoOff, GroupLayout.PREFERRED_SIZE, 77,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addComponent(lblOffValue, GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)))
                    .addContainerGap()));
    gl_panelOutputs//from   w w w. ja va  2s .  co  m
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblOffValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblTiempoOff, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(lblO1).addComponent(lblTValue))
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblEValue, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE))))));
    panelOutputs.setLayout(gl_panelOutputs);

    JPanel panelLicense = new JPanel();
    panelLicense.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control
            .setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
                    .addGroup(Alignment.LEADING, gl_panel_control.createSequentialGroup().addContainerGap()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
                                    .addComponent(panelOutputs, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                                    .addComponent(panel_6, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 346,
                                            Short.MAX_VALUE)
                                    .addComponent(panelLicense, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE))
                            .addContainerGap()));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 305, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 76, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(24)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
            gl_panel_6.createSequentialGroup().addContainerGap()
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                    .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6
                    .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation,
                            GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(69, Short.MAX_VALUE)));
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panelLicense.add(lblNewLabel);

    JLabel LabelI1 = new JLabel("Potencia");
    LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI2 = new JLabel("T1");
    labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI3 = new JLabel("T2");
    labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblT1Value = new JLabel("20");
    lblT1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblT2Value = new JLabel("-15");
    lblT2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblPValue = new JLabel("700");
    lblPValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderP = new JSlider();
    sliderP.setMinimum(500);
    sliderP.setMaximum(1000);
    sliderP.setMinorTickSpacing(50);
    sliderP.setValue(700);
    sliderP.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

    sliderT1 = new JSlider();
    sliderT1.setMinimum(18);
    sliderT1.setMaximum(30);
    sliderT1.setMinorTickSpacing(1);
    sliderT1.setValue(20);
    sliderT1.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI2Event();
        }
    });

    sliderT2 = new JSlider();
    sliderT2.setMinimum(10);
    sliderT2.setMaximum(30);
    sliderT2.setValue(15);
    sliderT2.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

    JLabel lblQo = new JLabel("Qo");
    lblQo.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblQcValue = new JLabel("25");
    lblQcValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderQc = new JSlider();
    sliderQc.setMinimum(10);
    sliderQc.setMaximum(50);
    sliderQc.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI4Event();
        }
    });
    sliderQc.setValue(25);
    sliderQc.setMinorTickSpacing(1);

    btn1 = new JButton("1");
    btn1.setFont(new Font("Tahoma", Font.PLAIN, 21));
    btn1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnMilk.setEnabled(false);
            btnFish.setEnabled(false);
            btnMetal.setEnabled(false);
            btn1.setEnabled(false);
            btn2.setEnabled(true);
            sliderQc.setEnabled(true);
            lblQcValue.setText("" + sliderQc.getValue());

        }
    });

    btn2 = new JButton("2");
    btn2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnMilk.setEnabled(true);
            btnFish.setEnabled(true);
            btnMetal.setEnabled(true);
            btn1.setEnabled(true);
            btn2.setEnabled(false);
            phase = 2;
            sliderQc.setEnabled(false);
            lblQcValue.setText("-");

        }
    });
    btn2.setFont(new Font("Tahoma", Font.PLAIN, 21));

    fishImage = loadImage(fish);
    btnFish = new JButton(new ImageIcon(fishImage));
    btnFish.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnFishFunction();
        }
    });

    milkImage = loadImage(milk);
    btnMilk = new JButton(new ImageIcon(milkImage));
    btnMilk.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnMilkFunction();
        }
    });

    metalImage = loadImage(metal);
    btnMetal = new JButton(new ImageIcon(metalImage));
    btnMetal.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnMetalFunction();
        }
    });

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs
            .setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                    .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
                    .addGroup(gl_panelInputs.createSequentialGroup().addGap(38).addGroup(gl_panelInputs
                            .createParallelGroup(Alignment.LEADING).addGroup(
                                    gl_panelInputs.createSequentialGroup().addGap(36)
                                            .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 80,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.UNRELATED)
                                            .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 80,
                                                    GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                                    .createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblQo, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(labelI3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addComponent(labelI2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addComponent(LabelI1, GroupLayout.DEFAULT_SIZE, 66, Short.MAX_VALUE))
                                    .addGap(18)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                            .addGroup(gl_panelInputs.createSequentialGroup()
                                                    .addGroup(gl_panelInputs
                                                            .createParallelGroup(Alignment.LEADING)
                                                            .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE,
                                                                    42, GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(lblT1Value,
                                                                    GroupLayout.PREFERRED_SIZE, 56,
                                                                    GroupLayout.PREFERRED_SIZE)
                                                            .addComponent(lblT2Value,
                                                                    GroupLayout.PREFERRED_SIZE, 56,
                                                                    GroupLayout.PREFERRED_SIZE))
                                                    .addGap(18)
                                                    .addGroup(gl_panelInputs
                                                            .createParallelGroup(Alignment.LEADING, false)
                                                            .addComponent(sliderT1, 0, 0, Short.MAX_VALUE)
                                                            .addComponent(sliderP, GroupLayout.DEFAULT_SIZE,
                                                                    134, Short.MAX_VALUE)
                                                            .addComponent(sliderT2, 0, 0, Short.MAX_VALUE)))
                                            .addGroup(gl_panelInputs.createSequentialGroup()
                                                    .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 56,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18)
                                                    .addComponent(sliderQc, 0, 0, Short.MAX_VALUE)))))
                            .addContainerGap(14, Short.MAX_VALUE))
                    .addGroup(Alignment.TRAILING, gl_panelInputs.createSequentialGroup()
                            .addContainerGap(28, Short.MAX_VALUE)
                            .addComponent(btnFish, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(btnMetal, GroupLayout.PREFERRED_SIZE, 93, GroupLayout.PREFERRED_SIZE)
                            .addGap(25)));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(LabelI1).addComponent(lblPValue, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderP, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelI2).addComponent(lblT1Value, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderT1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3)
                            .addComponent(lblT2Value, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderT2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblQo, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderQc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
                            .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(btnMetal, GroupLayout.PREFERRED_SIZE, 72,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 72,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelInputs.createSequentialGroup().addGap(1).addComponent(btnFish,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addContainerGap(12, Short.MAX_VALUE)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 398, GroupLayout.PREFERRED_SIZE)
                    .addGap(452)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(groupLayout
            .createSequentialGroup()
            .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                    .addGroup(Alignment.LEADING,
                            groupLayout.createSequentialGroup().addGap(12).addComponent(panel_visualizar,
                                    GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE))
                    .addGroup(groupLayout.createSequentialGroup().addContainerGap().addComponent(panel_control,
                            GroupLayout.PREFERRED_SIZE, 568, GroupLayout.PREFERRED_SIZE)))
            .addContainerGap()));

    JPanel panel = new JPanel();

    panelGrafica = new JPanelGrafica();
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGap(0, 384, Short.MAX_VALUE)
            .addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
            .addComponent(panelGrafica, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE));
    panel.setLayout(gl_panel);
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE));
    gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 567, Short.MAX_VALUE));

    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:com.juanhg.angularmdisk.AngularMDiskApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTiempo = new JPanel();
    panelTiempo.setToolTipText("");
    panelTiempo.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    btnPhase1 = new JButton("Lanzar Insecto");
    btnPhase1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnPhase1Event();//from  w  ww.ja  va2s.  co  m
        }
    });
    btnPhase1.setEnabled(false);

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblDiskW = new JLabel("Velocidad Disco:");
    lblDiskW.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblDiskWValue = new JLabel();
    lblDiskWValue.setText("0");
    lblDiskWValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblCriticRadius = new JLabel("Radio Cr\u00EDtico:");
    lblCriticRadius.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblCriticRadiusValue = new JLabel();
    lblCriticRadiusValue.setText("0");
    lblCriticRadiusValue.setFont(new Font("Tahoma", Font.PLAIN, 14));
    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblCriticRadius, GroupLayout.PREFERRED_SIZE, 119,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(6))
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblDiskW, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addGap(26)))
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblDiskWValue, GroupLayout.PREFERRED_SIZE, 147,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblCriticRadiusValue, GroupLayout.PREFERRED_SIZE, 147,
                                    GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(112, Short.MAX_VALUE)));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblDiskW).addComponent(lblDiskWValue))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblCriticRadius, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblCriticRadiusValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(121)));
    panelOutputs.setLayout(gl_panelOutputs);

    panel_1 = new JPanel();
    panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panel_control.createSequentialGroup()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 396,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(panelOutputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            396, Short.MAX_VALUE)
                                    .addComponent(panelTiempo, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE))
                            .addGap(18))
                    .addGroup(gl_panel_control.createSequentialGroup()
                            .addComponent(panel_1, GroupLayout.PREFERRED_SIZE, 397, GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(17, Short.MAX_VALUE)))));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 202, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelTiempo, GroupLayout.PREFERRED_SIZE, 210, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED, 15, Short.MAX_VALUE).addComponent(panel_1,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panel_1.add(lblNewLabel);

    rdbtnCam1 = new JRadioButton("C\u00E1mara Fija");
    rdbtnCam1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            rdbtnCam1Event();
        }
    });
    rdbtnCam1.setSelected(true);

    rdbtnCam2 = new JRadioButton("C\u00E1mara M\u00F3vil");
    rdbtnCam2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            rdbtnCam2Event();
        }
    });

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });

    btnPauseContinue = new JButton("Pausar");
    btnPauseContinue.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnPauseContinue.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnPauseContinueEvent(event);
        }
    });

    panel = new JPanel();
    panel.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    label = new JLabel("Datos de la Simulaci\u00F3n");
    label.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel.add(label);
    GroupLayout gl_panelTiempo = new GroupLayout(panelTiempo);
    gl_panelTiempo.setHorizontalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelTiempo.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING, false)
                            .addComponent(btnPhase1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 176, Short.MAX_VALUE))
                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING).addGroup(gl_panelTiempo
                            .createSequentialGroup().addGap(52)
                            .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
                                    .addComponent(rdbtnCam2).addComponent(rdbtnCam1, GroupLayout.PREFERRED_SIZE,
                                            113, GroupLayout.PREFERRED_SIZE)))
                            .addGroup(gl_panelTiempo.createSequentialGroup().addGap(21).addComponent(
                                    btnPauseContinue, GroupLayout.PREFERRED_SIZE, 168,
                                    GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap(47, Short.MAX_VALUE))
            .addComponent(panel, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 394, Short.MAX_VALUE));
    gl_panelTiempo.setVerticalGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelTiempo.createSequentialGroup()
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE).addGap(22)
                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelTiempo.createSequentialGroup().addComponent(rdbtnCam1)
                                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(rdbtnCam2))
                            .addComponent(btnPhase1, GroupLayout.PREFERRED_SIZE, 58,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(18)
                    .addGroup(gl_panelTiempo.createParallelGroup(Alignment.LEADING)
                            .addComponent(btnPauseContinue, GroupLayout.PREFERRED_SIZE, 62,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(btnLaunchSimulation, GroupLayout.PREFERRED_SIZE, 62,
                                    GroupLayout.PREFERRED_SIZE))));
    panelTiempo.setLayout(gl_panelTiempo);

    JLabel LabelBugMass = new JLabel("Masa del Insecto");
    LabelBugMass.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelFallRadio = new JLabel("Radio de Ca\u00EDda");
    labelFallRadio.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelBugVelocity = new JLabel("Velocidad del Insecto");
    labelBugVelocity.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelDiskVelocity = new JLabel("Velocidad del Disco");
    labelDiskVelocity.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblFallRadiusValue = new JLabel("10");
    lblFallRadiusValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblBugVelocityValue = new JLabel("1");
    lblBugVelocityValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVelocityValue = new JLabel("0.5");
    lblVelocityValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblInitMassValue = new JLabel("30");
    lblInitMassValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderBugInitMass = new JSlider();
    sliderBugInitMass.setValue(30);
    sliderBugInitMass.setMinimum(20);
    sliderBugInitMass.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderBugInitMassEvent();
        }
    });
    sliderBugInitMass.setMaximum(70);

    sliderFallRadius = new JSlider();
    sliderFallRadius.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderFallRadiusEvent();
        }
    });
    sliderFallRadius.setValue(10);
    sliderFallRadius.setMinorTickSpacing(1);
    sliderFallRadius.setMaximum(20);

    sliderBugVelocity = new JSlider();
    sliderBugVelocity.setValue(10);
    sliderBugVelocity.setMaximum(20);
    sliderBugVelocity.setMinimum(5);
    sliderBugVelocity.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderBugVelocityEvent();
        }
    });
    sliderBugVelocity.setMinorTickSpacing(1);

    sliderDiskVelocity = new JSlider();
    sliderDiskVelocity.setMaximum(10);
    sliderDiskVelocity.setMinimum(1);
    sliderDiskVelocity.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderDiskVelocityEvent();
        }
    });
    sliderDiskVelocity.setValue(5);
    sliderDiskVelocity.setMinorTickSpacing(1);

    JLabel lblCoeficienteDeRozamiento = new JLabel("Coef de Rozamiento");
    lblCoeficienteDeRozamiento.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblFrictionValue = new JLabel("0.25");
    lblFrictionValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderFriction = new JSlider();
    sliderFriction.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderFrictionEvent();
        }
    });
    sliderFriction.setValue(25);
    sliderFriction.setMinorTickSpacing(1);
    sliderFriction.setMinimum(1);
    sliderFriction.setMaximum(90);

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                            .addComponent(labelBugVelocity, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(LabelBugMass, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(labelFallRadio, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 120,
                                    Short.MAX_VALUE))
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblInitMassValue, GroupLayout.PREFERRED_SIZE, 42,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFallRadiusValue, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBugVelocityValue, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(sliderFallRadius, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderBugInitMass, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderBugVelocity, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderDiskVelocity, GroupLayout.PREFERRED_SIZE, 146,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(26))
            .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                            .addComponent(lblCoeficienteDeRozamiento, Alignment.LEADING,
                                    GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
                            .addComponent(labelDiskVelocity, GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                            .addGroup(Alignment.TRAILING,
                                    gl_panelInputs.createSequentialGroup()
                                            .addComponent(lblVelocityValue, GroupLayout.PREFERRED_SIZE, 43,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(204))
                            .addGroup(Alignment.TRAILING,
                                    gl_panelInputs.createSequentialGroup()
                                            .addComponent(lblFrictionValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(sliderFriction, GroupLayout.PREFERRED_SIZE, 146,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(26))))
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 396, Short.MAX_VALUE));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(8)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(LabelBugMass).addComponent(lblInitMassValue,
                                            GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderBugInitMass, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelFallRadio).addComponent(lblFallRadiusValue,
                                            GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderFallRadius, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(
                            gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelBugVelocity)
                                    .addComponent(lblBugVelocityValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(sliderBugVelocity, GroupLayout.PREFERRED_SIZE,
                                            GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelDiskVelocity).addComponent(lblVelocityValue,
                                            GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderDiskVelocity, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup().addGap(12)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(lblCoeficienteDeRozamiento,
                                                    GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblFrictionValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(sliderFriction,
                                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.PREFERRED_SIZE)))
                    .addGap(47)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 432, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 560, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(32, Short.MAX_VALUE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                            .addComponent(panel_visualizar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 598,
                                    Short.MAX_VALUE)
                            .addComponent(panel_control, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 598,
                                    Short.MAX_VALUE))
                    .addContainerGap()));
    GridBagLayout gbl_panel_visualizar = new GridBagLayout();
    gbl_panel_visualizar.columnWidths = new int[] { 0, 0 };
    gbl_panel_visualizar.rowHeights = new int[] { 0, 0, 0 };
    gbl_panel_visualizar.columnWeights = new double[] { 1.0, Double.MIN_VALUE };
    gbl_panel_visualizar.rowWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
    panel_visualizar.setLayout(gbl_panel_visualizar);

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    GridBagConstraints gbc_tabbedPane = new GridBagConstraints();
    gbc_tabbedPane.gridheight = 2;
    gbc_tabbedPane.fill = GridBagConstraints.BOTH;
    gbc_tabbedPane.gridx = 0;
    gbc_tabbedPane.gridy = 0;
    panel_visualizar.add(tabbedPane, gbc_tabbedPane);

    panelSimulation = new JPanelGrafica();
    tabbedPane.addTab("Simulacin", null, panelSimulation, null);
    panelSimulation.setBackground(Color.WHITE);

    getContentPane().setLayout(groupLayout);
}

From source file:com.juanhg.car.CarApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblWc = new JLabel("Wc:");
    lblWc.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblWcValue = new JLabel();
    lblWcValue.setText("0");
    lblWcValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblNc = new JLabel("Ciclos:");
    lblNc.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblNcValue = new JLabel();
    lblNcValue.setText("0");
    lblNcValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO3 = new JLabel("Tmax:");
    lblO3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTmaxValue = new JLabel();
    lblTmaxValue.setText("0");
    lblTmaxValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblV = new JLabel("V:");
    lblV.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblP = new JLabel("P:");
    lblP.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblH = new JLabel("Eta:");
    lblH.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblEtaValue = new JLabel();
    lblEtaValue.setText("0");
    lblEtaValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblPValue = new JLabel();
    lblPValue.setText("0");
    lblPValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVValue = new JLabel();
    lblVValue.setText("0");
    lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblF = new JLabel("F:");
    lblF.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblFValue = new JLabel();
    lblFValue.setText("0");
    lblFValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblDist = new JLabel("Dist:");
    lblDist.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblXValue = new JLabel();
    lblXValue.setText("0");
    lblXValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGroup(gl_panelOutputs
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap().addGroup(gl_panelOutputs
                            .createParallelGroup(Alignment.LEADING)
                            .addComponent(lblNc, GroupLayout.PREFERRED_SIZE, 49, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING, false)
                                    .addComponent(lblWc, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lblP, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addComponent(lblV, GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)))
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblWcValue, GroupLayout.DEFAULT_SIZE, 92, Short.MAX_VALUE)
                                    .addComponent(lblNcValue, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(lblVValue, GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
                                    .addComponent(lblPValue, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblDist, GroupLayout.PREFERRED_SIZE, 40,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblXValue,
                                                    GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblF, GroupLayout.PREFERRED_SIZE, 40,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblFValue,
                                                    GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE))
                                    .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblH)
                                            .addGap(18).addComponent(lblEtaValue, GroupLayout.DEFAULT_SIZE, 79,
                                                    Short.MAX_VALUE))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 40,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED)
                                            .addComponent(lblTmaxValue, GroupLayout.DEFAULT_SIZE, 76,
                                                    Short.MAX_VALUE))))
                    .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, 299,
                            GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));
    gl_panelOutputs.setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelOutputs.createSequentialGroup()
                    .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(20)/*from   w w w  .  j  a  v  a 2  s.  c  o m*/
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblWc)
                                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblNc,
                                            GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelOutputs.createSequentialGroup().addComponent(lblWcValue)
                                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(lblNcValue,
                                            GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(lblH, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblEtaValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(lblO3, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblTmaxValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE))))
                    .addGap(11)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblF, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblFValue, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblDist, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblXValue, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(30, Short.MAX_VALUE)));
    panelOutputs.setLayout(gl_panelOutputs);

    JPanel panelLicense = new JPanel();
    panelLicense.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control.setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap().addGroup(gl_panel_control
                    .createParallelGroup(Alignment.TRAILING)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE)
                    .addComponent(panelInputs, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 300,
                            Short.MAX_VALUE)
                    .addComponent(panel_6, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
                    .addComponent(panelLicense, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 300,
                            Short.MAX_VALUE))
                    .addContainerGap()));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 211, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.DEFAULT_SIZE, 184, Short.MAX_VALUE).addGap(18)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 74, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED).addComponent(panelLicense,
                            GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                    .addGap(24)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6.createSequentialGroup().addContainerGap()
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 278, Short.MAX_VALUE)
                    .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6
                    .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation,
                            GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(69, Short.MAX_VALUE)));
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panelLicense.add(lblNewLabel);

    JLabel lblVa = new JLabel("Va");
    lblVa.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblR = new JLabel("R");
    lblR.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblMg = new JLabel("mg");
    lblMg.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblRValue = new JLabel("8");
    lblRValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblMgValue = new JLabel("10");
    lblMgValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVaValue = new JLabel("6");
    lblVaValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderVa = new JSlider();
    sliderVa.setMinimum(5);
    sliderVa.setMaximum(8);
    sliderVa.setMinorTickSpacing(1);
    sliderVa.setValue(6);
    sliderVa.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

    sliderR = new JSlider();
    sliderR.setMinimum(7);
    sliderR.setMaximum(13);
    sliderR.setMinorTickSpacing(1);
    sliderR.setValue(8);
    sliderR.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI2Event();
        }
    });

    sliderMg = new JSlider();
    sliderMg.setMinimum(1);
    sliderMg.setMaximum(20);
    sliderMg.setValue(10);
    sliderMg.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

    JLabel lblIVcar = new JLabel("Velocidad");
    lblIVcar.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVcarValue = new JLabel("120");
    lblVcarValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderVcar = new JSlider();
    sliderVcar.setMinimum(1);
    sliderVcar.setMaximum(160);
    sliderVcar.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI4Event();
        }
    });
    sliderVcar.setValue(120);
    sliderVcar.setMinorTickSpacing(1);

    sliderQc = new JSlider();
    sliderQc.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI5Event();
        }
    });
    sliderQc.setMaximum(1500);
    sliderQc.setMinimum(500);
    sliderQc.setValue(600);
    sliderQc.setMinorTickSpacing(100);

    lblQcValue = new JLabel("600");
    lblQcValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblQc = new JLabel("Qc");
    lblQc.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panelInputs.createSequentialGroup().addGap(20).addGroup(gl_panelInputs
                    .createParallelGroup(Alignment.TRAILING)
                    .addGroup(gl_panelInputs.createSequentialGroup()
                            .addComponent(lblQc, GroupLayout.PREFERRED_SIZE, 61, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED, 24, Short.MAX_VALUE)
                            .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 56,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(18)
                            .addComponent(sliderQc, GroupLayout.PREFERRED_SIZE, 88, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED))
                    .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                            .createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                                    .createParallelGroup(Alignment.TRAILING)
                                    .addComponent(lblMg, GroupLayout.DEFAULT_SIZE, 67, Short.MAX_VALUE)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVa, GroupLayout.PREFERRED_SIZE, 62,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblIVcar, Alignment.TRAILING,
                                                    GroupLayout.PREFERRED_SIZE, 67,
                                                    GroupLayout.PREFERRED_SIZE)))
                                    .addGap(18))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(lblR, GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
                                    .addPreferredGap(ComponentPlacement.RELATED)))
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                                    .addGroup(gl_panelInputs.createSequentialGroup()
                                            .addComponent(lblVcarValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(18)
                                            .addComponent(sliderVcar, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED))
                                    .addGroup(gl_panelInputs.createSequentialGroup()
                                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                                    .addComponent(lblVaValue, GroupLayout.PREFERRED_SIZE, 42,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblRValue, GroupLayout.PREFERRED_SIZE, 56,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblMgValue, GroupLayout.PREFERRED_SIZE, 56,
                                                            GroupLayout.PREFERRED_SIZE))
                                            .addGap(18).addGroup(
                                                    gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                                            .addComponent(sliderVa, 0, 0, Short.MAX_VALUE)
                                                            .addComponent(sliderR, 0, 0, Short.MAX_VALUE)
                                                            .addComponent(sliderMg, GroupLayout.PREFERRED_SIZE,
                                                                    88, GroupLayout.PREFERRED_SIZE))))))
                    .addGap(48))
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 315, Short.MAX_VALUE));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblVaValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                    sliderVa, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(lblRValue, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblR))
                                            .addComponent(sliderR, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                                    .addGap(11)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                                    .addComponent(lblMgValue, GroupLayout.PREFERRED_SIZE, 17,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblMg))
                                            .addComponent(sliderMg, GroupLayout.PREFERRED_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
                            .addComponent(lblVa))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblVcarValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblIVcar, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderVcar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblQc, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblQcValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderQc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(3)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 325, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 688, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(94, Short.MAX_VALUE)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(groupLayout.createSequentialGroup().addContainerGap()
                    .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
                            .addComponent(panel_visualizar, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 568,
                                    Short.MAX_VALUE)
                            .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, 568,
                                    GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    JPanel panel = new JPanel();
    panel.setBackground(Color.WHITE);

    JPanel panel_1 = new JPanel();

    panelPlot = new JPanelGrafica();
    GroupLayout gl_panel_1 = new GroupLayout(panel_1);
    gl_panel_1.setHorizontalGroup(
            gl_panel_1.createParallelGroup(Alignment.LEADING).addGap(0, 263, Short.MAX_VALUE)
                    .addComponent(panelPlot, GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE));
    gl_panel_1
            .setVerticalGroup(gl_panel_1.createParallelGroup(Alignment.LEADING).addGap(0, 241, Short.MAX_VALUE)
                    .addComponent(panelPlot, GroupLayout.DEFAULT_SIZE, 241, Short.MAX_VALUE));
    panel_1.setLayout(gl_panel_1);

    JPanel panel_2 = new JPanel();

    panelMotor = new JPanelGrafica();
    GroupLayout gl_panel_2 = new GroupLayout(panel_2);
    gl_panel_2.setHorizontalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING).addComponent(panelMotor,
            Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE));
    gl_panel_2.setVerticalGroup(gl_panel_2.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_2.createSequentialGroup()
                    .addComponent(panelMotor, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_2.setLayout(gl_panel_2);
    GroupLayout gl_panel = new GroupLayout(panel);
    gl_panel.setHorizontalGroup(gl_panel.createParallelGroup(Alignment.TRAILING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addComponent(panel_1, GroupLayout.DEFAULT_SIZE, 384, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_2, GroupLayout.PREFERRED_SIZE, 258, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    gl_panel.setVerticalGroup(gl_panel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel.createParallelGroup(Alignment.LEADING)
                            .addComponent(panel_1, GroupLayout.PREFERRED_SIZE, 241, GroupLayout.PREFERRED_SIZE)
                            .addComponent(panel_2, 0, 0, Short.MAX_VALUE))
                    .addContainerGap()));
    panel.setLayout(gl_panel);

    JPanel panel_3 = new JPanel();
    panel_3.setBackground(Color.WHITE);

    JPanel panel_4 = new JPanel();

    panelCar = new JPanelGrafica();
    GroupLayout gl_panel_4 = new GroupLayout(panel_4);
    gl_panel_4.setHorizontalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING).addComponent(panelCar,
            GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE));
    gl_panel_4.setVerticalGroup(gl_panel_4.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_4.createSequentialGroup()
                    .addComponent(panelCar, GroupLayout.PREFERRED_SIZE, 252, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    panel_4.setLayout(gl_panel_4);
    GroupLayout gl_panel_3 = new GroupLayout(panel_3);
    gl_panel_3.setHorizontalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_3.createSequentialGroup().addContainerGap()
                    .addComponent(panel_4, GroupLayout.DEFAULT_SIZE, 648, Short.MAX_VALUE).addContainerGap()));
    gl_panel_3.setVerticalGroup(gl_panel_3.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_3.createSequentialGroup().addContainerGap()
                    .addComponent(panel_4, GroupLayout.PREFERRED_SIZE, 252, Short.MAX_VALUE)
                    .addContainerGap()));
    panel_3.setLayout(gl_panel_3);
    GroupLayout gl_panel_visualizar = new GroupLayout(panel_visualizar);
    gl_panel_visualizar.setHorizontalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(Alignment.TRAILING, gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addGroup(gl_panel_visualizar.createParallelGroup(Alignment.TRAILING)
                            .addComponent(panel_3, GroupLayout.PREFERRED_SIZE, 668, GroupLayout.PREFERRED_SIZE)
                            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 668, Short.MAX_VALUE))
                    .addContainerGap()));
    gl_panel_visualizar.setVerticalGroup(gl_panel_visualizar.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_visualizar.createSequentialGroup().addContainerGap()
                    .addComponent(panel, GroupLayout.PREFERRED_SIZE, 261, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(panel_3, GroupLayout.DEFAULT_SIZE, 274, Short.MAX_VALUE).addContainerGap()));

    panel_visualizar.setLayout(gl_panel_visualizar);

    getContentPane().setLayout(groupLayout);
}

From source file:edu.ucla.stat.SOCR.applications.demo.PortfolioApplication2.java

public void addRadioButton(int x, int y, String text, String toolTipText, String[] bValues, int defaultIndex,
        JPanel panel, ActionListener l) {
    JPanel p = new JPanel();

    p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS));

    GridBagConstraints c = new GridBagConstraints();
    c.gridx = x;//from w  w w .j  ava 2 s . c o m
    c.gridy = y;

    ButtonGroup group = new ButtonGroup();

    p.setToolTipText(toolTipText);
    p.add(new JLabel(text));

    rButtons = new JRadioButton[bValues.length];
    for (int i = 0; i < bValues.length; i++) {
        rButtons[i] = new JRadioButton(bValues[i]);
        rButtons[i].setName(bValues[i]);
        rButtons[i].addActionListener(l);
        rButtons[i].setActionCommand(bValues[i]);
        p.add(rButtons[i]);
        group.add(rButtons[i]);
        if (defaultIndex == i)
            rButtons[i].setSelected(true);
    }
    panel.add(p, c);
}

From source file:com.juanhg.icecubes.IceCubesApplet.java

private void autogeneratedCode() {
    JPanel panel_control = new JPanel();
    panel_control.setBorder(new CompoundBorder(new EtchedBorder(EtchedBorder.RAISED, null, null),
            new BevelBorder(BevelBorder.RAISED, null, null, null, null)));

    JPanel panelInputs = new JPanel();
    panelInputs.setToolTipText("");
    panelInputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelOutputs = new JPanel();
    panelOutputs.setToolTipText("");
    panelOutputs.setBorder(new MatteBorder(1, 1, 1, 1, (Color) new Color(0, 0, 0)));

    JPanel panelTitleOutputs = new JPanel();
    panelTitleOutputs.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel labelOutputData = new JLabel("Datos de la Simulaci\u00F3n");
    labelOutputData.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitleOutputs.add(labelOutputData);

    lblO1 = new JLabel("T:");
    lblO1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO1Value = new JLabel();
    lblO1Value.setText("0");
    lblO1Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblO2 = new JLabel("t:");
    lblO2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblO2Value = new JLabel();
    lblO2Value.setText("0");
    lblO2Value.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel lblV = new JLabel("V:");
    lblV.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVValue = new JLabel();
    lblVValue.setText("0");
    lblVValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    GroupLayout gl_panelOutputs = new GroupLayout(panelOutputs);
    gl_panelOutputs.setHorizontalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
            .addComponent(panelTitleOutputs, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup()
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.TRAILING)
                            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(22)
                                    .addComponent(lblO1, GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
                                    .addPreferredGap(ComponentPlacement.RELATED))
                            .addGroup(gl_panelOutputs.createSequentialGroup().addContainerGap()
                                    .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 57,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(37)))
                    .addGroup(//w  ww.j  a  v  a  2 s  . c om
                            gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblO1Value, GroupLayout.DEFAULT_SIZE, 52,
                                                    Short.MAX_VALUE)
                                            .addGap(3))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblO2Value, GroupLayout.PREFERRED_SIZE, 55,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED)))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 44, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));
    gl_panelOutputs
            .setVerticalGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addComponent(panelTitleOutputs, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblO1).addComponent(lblO1Value)
                                    .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.UNRELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblO2, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblO2Value, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(40)));
    panelOutputs.setLayout(gl_panelOutputs);

    JPanel panelLicense = new JPanel();
    panelLicense.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel_6 = new JPanel();
    panel_6.setBorder(new LineBorder(new Color(0, 0, 0)));
    GroupLayout gl_panel_control = new GroupLayout(panel_control);
    gl_panel_control
            .setHorizontalGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
                    .addGroup(Alignment.LEADING, gl_panel_control.createSequentialGroup().addContainerGap()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
                                    .addComponent(panelOutputs, Alignment.TRAILING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                                    .addComponent(panel_6, Alignment.TRAILING, GroupLayout.PREFERRED_SIZE, 346,
                                            Short.MAX_VALUE)
                                    .addComponent(panelLicense, GroupLayout.DEFAULT_SIZE, 346, Short.MAX_VALUE))
                            .addContainerGap()));
    gl_panel_control.setVerticalGroup(gl_panel_control.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_control.createSequentialGroup().addContainerGap()
                    .addComponent(panelInputs, GroupLayout.PREFERRED_SIZE, 225, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 112, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 80, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelLicense, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    btnLaunchSimulation = new JButton("Iniciar");
    btnLaunchSimulation.setFont(new Font("Tahoma", Font.PLAIN, 16));
    btnLaunchSimulation.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            btnLaunchSimulationEvent(event);
        }
    });
    GroupLayout gl_panel_6 = new GroupLayout(panel_6);
    gl_panel_6.setHorizontalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6.createSequentialGroup().addContainerGap()
                    .addComponent(btnLaunchSimulation, GroupLayout.DEFAULT_SIZE, 324, Short.MAX_VALUE)
                    .addContainerGap()));
    gl_panel_6.setVerticalGroup(gl_panel_6.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panel_6
                    .createSequentialGroup().addContainerGap().addComponent(btnLaunchSimulation,
                            GroupLayout.PREFERRED_SIZE, 55, GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(78, Short.MAX_VALUE)));
    panel_6.setLayout(gl_panel_6);

    JLabel lblNewLabel = new JLabel("GNU GENERAL PUBLIC LICENSE");
    panelLicense.add(lblNewLabel);

    JLabel LabelI1 = new JLabel("Volumen");
    LabelI1.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI2 = new JLabel("T");
    labelI2.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JLabel labelI3 = new JLabel("t");
    labelI3.setFont(new Font("Tahoma", Font.PLAIN, 14));

    JPanel panelTitle = new JPanel();
    panelTitle.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    lblTValue = new JLabel("15");
    lblTValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lbltValue = new JLabel("-15");
    lbltValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblVolValue = new JLabel("20");
    lblVolValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderVol = new JSlider();
    sliderVol.setMinimum(1);
    sliderVol.setMaximum(30);
    sliderVol.setMinorTickSpacing(1);
    sliderVol.setValue(20);
    sliderVol.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

    sliderT = new JSlider();
    sliderT.setMinimum(5);
    sliderT.setMaximum(30);
    sliderT.setMinorTickSpacing(1);
    sliderT.setValue(15);
    sliderT.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI2Event();
        }
    });

    slidert = new JSlider();
    slidert.setMinimum(5);
    slidert.setMaximum(30);
    slidert.setValue(15);
    slidert.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

    JLabel lblI4 = new JLabel("N\u00BA de Cubitos");
    lblI4.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblNValue = new JLabel("1");
    lblNValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderN = new JSlider();
    sliderN.setMinimum(1);
    sliderN.setMaximum(4);
    sliderN.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent arg0) {
            sliderI4Event();
        }
    });
    sliderN.setValue(1);
    sliderN.setMinorTickSpacing(1);

    waterImage = loadImage(water);
    btnWater = new JButton(new ImageIcon(waterImage));
    btnWater.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnWater.setEnabled(false);
            btnMilk.setEnabled(true);
            btnOrange.setEnabled(true);
            btnlemonade.setEnabled(true);

            type = WATER;

            fluidColor = new Color(100, 180, 255, 70);
            updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue()));
            repaint();
        }
    });

    milkImage = loadImage(milk);
    btnMilk = new JButton(new ImageIcon(milkImage));
    btnMilk.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btnWater.setEnabled(true);
            btnMilk.setEnabled(false);
            btnOrange.setEnabled(true);
            btnlemonade.setEnabled(true);

            type = MILK;

            fluidColor = new Color(255, 255, 255, 255);
            updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue()));
            repaint();
        }
    });

    orangeImage = loadImage(orange);
    btnOrange = new JButton(new ImageIcon(orangeImage));
    btnOrange.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnWater.setEnabled(true);
            btnMilk.setEnabled(true);
            btnOrange.setEnabled(false);
            btnlemonade.setEnabled(true);

            type = ORANGE;

            fluidColor = new Color(225, 150, 0, 220);
            updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue()));
            repaint();
        }
    });

    lemonadeImage = loadImage(lemonade);
    btnlemonade = new JButton(new ImageIcon(lemonadeImage));
    btnlemonade.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            btnWater.setEnabled(true);
            btnMilk.setEnabled(true);
            btnOrange.setEnabled(true);
            btnlemonade.setEnabled(false);

            type = LEMONADE;

            fluidColor = new Color(225, 225, 0, 150);
            updateGlass(IceCubesModel.getV(sliderVol.getValue(), sliderN.getValue()));
            repaint();
        }
    });

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addComponent(panelTitle, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 344, Short.MAX_VALUE)
            .addGroup(gl_panelInputs.createSequentialGroup().addContainerGap(23, Short.MAX_VALUE)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING).addGroup(gl_panelInputs
                            .createSequentialGroup()
                            .addComponent(btnWater, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(btnMilk, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(btnOrange, GroupLayout.PREFERRED_SIZE, 70, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addComponent(btnlemonade, GroupLayout.PREFERRED_SIZE, 70,
                                    GroupLayout.PREFERRED_SIZE)
                            .addGap(8))
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                    .addGroup(gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                                            .createParallelGroup(Alignment.TRAILING, false)
                                            .addComponent(labelI3, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(LabelI1, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                                    GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(labelI2, Alignment.LEADING,
                                                    GroupLayout.PREFERRED_SIZE, 120,
                                                    GroupLayout.PREFERRED_SIZE))
                                            .addGap(18)
                                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                                    .addComponent(lblVolValue, GroupLayout.PREFERRED_SIZE, 42,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 56,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lbltValue, GroupLayout.PREFERRED_SIZE, 56,
                                                            GroupLayout.PREFERRED_SIZE))
                                            .addGap(18).addGroup(
                                                    gl_panelInputs.createParallelGroup(Alignment.LEADING, false)
                                                            .addComponent(sliderVol, 0, 0, Short.MAX_VALUE)
                                                            .addComponent(sliderT, 0, 0, Short.MAX_VALUE)
                                                            .addComponent(slidert, GroupLayout.PREFERRED_SIZE,
                                                                    88, GroupLayout.PREFERRED_SIZE)))
                                    .addGroup(gl_panelInputs.createSequentialGroup()
                                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 120,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(18)
                                            .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addGap(18).addComponent(sliderN, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE))))
                    .addGap(15)));
    gl_panelInputs.setVerticalGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_panelInputs.createSequentialGroup()
                    .addComponent(panelTitle, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addGap(18)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(LabelI1).addComponent(lblVolValue, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderVol, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(labelI2).addComponent(lblTValue, GroupLayout.PREFERRED_SIZE,
                                            17, GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderT, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(labelI3)
                            .addComponent(lbltValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(slidert, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblI4, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblNValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderN, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(7)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING, false)
                            .addComponent(btnWater, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addComponent(btnMilk, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                            .addComponent(btnOrange, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE)
                            .addComponent(btnlemonade, GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
                    .addGap(11)));

    JLabel lblDatosDeEntrada = new JLabel("Datos de Entrada");
    lblDatosDeEntrada.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panelTitle.add(lblDatosDeEntrada);
    panelInputs.setLayout(gl_panelInputs);
    panel_control.setLayout(gl_panel_control);

    JPanel panel_visualizar = new JPanel();
    panel_visualizar.setBackground(Color.WHITE);

    GroupLayout groupLayout = new GroupLayout(getContentPane());
    groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.LEADING).addGroup(
            Alignment.TRAILING,
            groupLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(panel_control, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                            GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_visualizar, GroupLayout.PREFERRED_SIZE, 694, GroupLayout.PREFERRED_SIZE)
                    .addGap(156)));
    groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.TRAILING).addGroup(Alignment.LEADING,
            groupLayout.createSequentialGroup().addGap(12)
                    .addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
                            .addComponent(panel_visualizar, Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                            .addComponent(panel_control, Alignment.LEADING, GroupLayout.PREFERRED_SIZE, 494,
                                    Short.MAX_VALUE))
                    .addContainerGap(84, Short.MAX_VALUE)));

    JPanel panel = new JPanel();
    panel.setBorder(new LineBorder(new Color(0, 0, 0)));
    panel.setBounds(0, 0, 368, 494);
    panel.setBackground(Color.WHITE);

    JPanel panel_1 = new JPanel();
    panel_1.setBounds(1, 1, 366, 31);
    panel_1.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel lblSimulacin = new JLabel("Simulaci\u00F3n");
    lblSimulacin.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel_1.add(lblSimulacin);

    JPanel panel_3 = new JPanel();
    panel_3.setBorder(new LineBorder(new Color(0, 0, 0)));
    panel_3.setBackground(Color.WHITE);
    panel_3.setBounds(368, 0, 326, 494);
    panel_visualizar.setLayout(null);
    panel_visualizar.add(panel);
    panel.setLayout(null);
    panel.add(panel_1);

    panel_7 = new JPanelGrafica();
    panel_7.setBackground(Color.WHITE);
    panel_7.setBounds(1, 31, 366, 463);
    panel.add(panel_7);

    panelGlass = new JPanelGrafica();
    panelGlass.setBackground(Color.WHITE);
    GroupLayout gl_panel_7 = new GroupLayout(panel_7);
    gl_panel_7.setHorizontalGroup(gl_panel_7.createParallelGroup(Alignment.LEADING).addComponent(panelGlass,
            GroupLayout.DEFAULT_SIZE, 366, Short.MAX_VALUE));
    gl_panel_7.setVerticalGroup(gl_panel_7.createParallelGroup(Alignment.LEADING).addComponent(panelGlass,
            GroupLayout.DEFAULT_SIZE, 463, Short.MAX_VALUE));
    panel_7.setLayout(gl_panel_7);
    panel_visualizar.add(panel_3);
    panel_3.setLayout(null);

    JPanel panel_4 = new JPanel();
    panel_4.setBounds(1, 1, 324, 31);
    panel_4.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel lblGrficaDeEvolucin = new JLabel("Gr\u00E1fica de Evoluci\u00F3n (T frente a Q)");
    lblGrficaDeEvolucin.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel_4.add(lblGrficaDeEvolucin);
    panel_3.add(panel_4);

    JPanel panel7 = new JPanel();
    panel7.setBorder(new LineBorder(new Color(0, 0, 0)));
    panel7.setBackground(Color.WHITE);
    panel7.setBounds(1, 31, 324, 463);
    panel_3.add(panel7);
    panel7.setLayout(null);

    panelChart = new JPanelGrafica();
    panelChart.setBorder(new LineBorder(new Color(0, 0, 0)));
    panelChart.setBackground(Color.WHITE);
    panelChart.setBounds(0, 0, 324, 462);
    panel7.add(panelChart);

    getContentPane().setLayout(groupLayout);
}