Example usage for javax.swing GroupLayout PREFERRED_SIZE

List of usage examples for javax.swing GroupLayout PREFERRED_SIZE

Introduction

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

Prototype

int PREFERRED_SIZE

To view the source code for javax.swing GroupLayout PREFERRED_SIZE.

Click Source Link

Document

Indicates the preferred size from the component or gap should be used for a particular range value.

Usage

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();//  w  ww .jav a  2s . c o  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.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(/*  ww w.  j  a  v a 2  s. co m*/
                            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);
}

From source file:de.dmarcini.submatix.pclogger.gui.spx42LogGraphPanel.java

/**
 * Initialisiere das Panel fr die Verbindungen Project: SubmatixBTForPC Package: de.dmarcini.submatix.pclogger.gui
 * /*from  ww w .  j av a 2 s.  com*/
 * @author Dirk Marciniak (dirk_marciniak@arcor.de) Stand: 22.04.2012
 */
private void initPanel() {
    setLayout(new BorderLayout(0, 0));
    setBackground(Color.WHITE);
    topPanel = new JPanel();
    topPanel.setBackground(Color.WHITE);
    add(topPanel, BorderLayout.NORTH);
    deviceComboBox = new JComboBox<String>();
    deviceComboBox.setBackground(Color.WHITE);
    deviceComboBox.setMaximumRowCount(26);
    deviceComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
    deviceComboBox.setActionCommand("change_device_to_display");
    diveSelectComboBox = new JComboBox<String>();
    diveSelectComboBox.setBackground(Color.WHITE);
    diveSelectComboBox.setMaximumRowCount(26);
    diveSelectComboBox.setFont(new Font("Dialog", Font.PLAIN, 12));
    diveSelectComboBox.setActionCommand("change_dive_to_display");
    computeGraphButton = new JButton(LangStrings.getString("spx42LogGraphPanel.computeGraphButton.text")); //$NON-NLS-1$
    computeGraphButton.setMinimumSize(new Dimension(80, 23));
    computeGraphButton.setPreferredSize(new Dimension(80, 23));
    computeGraphButton.setSize(new Dimension(80, 23));
    computeGraphButton.setMaximumSize(new Dimension(80, 23));
    computeGraphButton.setActionCommand("show_log_graph");
    detailGraphButton = new JButton(LangStrings.getString("spx42LogGraphPanel.detailGraphButton.text")); //$NON-NLS-1$
    detailGraphButton.setMinimumSize(new Dimension(80, 23));
    detailGraphButton.setSize(new Dimension(80, 23));
    detailGraphButton.setPreferredSize(new Dimension(80, 23));
    detailGraphButton.setMaximumSize(new Dimension(80, 23));
    detailGraphButton.setActionCommand("set_detail_for_show_graph");
    GroupLayout gl_topPanel = new GroupLayout(topPanel);
    gl_topPanel.setHorizontalGroup(gl_topPanel.createParallelGroup(Alignment.TRAILING).addGroup(gl_topPanel
            .createSequentialGroup().addContainerGap().addComponent(deviceComboBox, 0, 270, Short.MAX_VALUE)
            .addGap(18)
            .addComponent(diveSelectComboBox, GroupLayout.PREFERRED_SIZE, 282, GroupLayout.PREFERRED_SIZE)
            .addGap(32)
            .addComponent(computeGraphButton, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                    GroupLayout.PREFERRED_SIZE)
            .addPreferredGap(ComponentPlacement.RELATED).addComponent(detailGraphButton,
                    GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
            .addGap(18)));
    gl_topPanel.setVerticalGroup(gl_topPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_topPanel.createSequentialGroup()
                    .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(gl_topPanel.createParallelGroup(Alignment.BASELINE)
                            .addComponent(deviceComboBox, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(computeGraphButton, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(detailGraphButton, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                            .addComponent(diveSelectComboBox, GroupLayout.PREFERRED_SIZE,
                                    GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))));
    topPanel.setLayout(gl_topPanel);
    bottomPanel = new JPanel();
    bottomPanel.setBackground(Color.WHITE);
    add(bottomPanel, BorderLayout.SOUTH);
    maxDepthValueLabel = new JLabel("0");
    coldestTempValueLabel = new JLabel("0");
    diveLenValueLabel = new JLabel("0");
    notesLabel = new JLabel(LangStrings.getString("spx42LoglistPanel.diveNotesLabel.text")); //$NON-NLS-1$
    notesLabel.setForeground(new Color(0, 100, 0));
    notesLabel.setFont(new Font("Tahoma", Font.ITALIC, 12));
    notesEditButton = new JButton("...");
    notesEditButton.setActionCommand("edit_notes_for_dive");
    notesEditButton.setIcon(
            new ImageIcon(spx42LogGraphPanel.class.getResource("/de/dmarcini/submatix/pclogger/res/142.png")));
    notesEditButton.setForeground(new Color(0, 100, 0));
    diluentLabel = new JLabel(""); //$NON-NLS-1$
    diluentLabel.setForeground(new Color(0, 0, 128));
    diluentLabel.setFont(new Font("Segoe UI", Font.PLAIN, 12));
    GroupLayout gl_bottomPanel = new GroupLayout(bottomPanel);
    gl_bottomPanel.setHorizontalGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_bottomPanel.createSequentialGroup().addContainerGap()
                    .addGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_bottomPanel.createSequentialGroup()
                                    .addComponent(maxDepthValueLabel, GroupLayout.PREFERRED_SIZE, 206,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(coldestTempValueLabel, GroupLayout.PREFERRED_SIZE, 211,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18)
                                    .addComponent(diveLenValueLabel, GroupLayout.PREFERRED_SIZE, 200,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(18))
                            .addGroup(Alignment.TRAILING,
                                    gl_bottomPanel.createSequentialGroup()
                                            .addGroup(gl_bottomPanel.createParallelGroup(Alignment.TRAILING)
                                                    .addComponent(diluentLabel, Alignment.LEADING,
                                                            GroupLayout.DEFAULT_SIZE, 667, Short.MAX_VALUE)
                                                    .addComponent(notesLabel, GroupLayout.DEFAULT_SIZE, 653,
                                                            Short.MAX_VALUE))
                                            .addPreferredGap(ComponentPlacement.RELATED)))
                    .addComponent(notesEditButton, GroupLayout.PREFERRED_SIZE, 75, GroupLayout.PREFERRED_SIZE)
                    .addGap(40)));
    gl_bottomPanel.setVerticalGroup(gl_bottomPanel.createParallelGroup(Alignment.LEADING)
            .addGroup(gl_bottomPanel.createSequentialGroup().addGap(18).addGroup(gl_bottomPanel
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(gl_bottomPanel.createSequentialGroup()
                            .addGroup(gl_bottomPanel.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(notesEditButton).addComponent(notesLabel))
                            .addContainerGap())
                    .addGroup(Alignment.TRAILING,
                            gl_bottomPanel
                                    .createParallelGroup(Alignment.BASELINE).addComponent(maxDepthValueLabel)
                                    .addComponent(coldestTempValueLabel).addComponent(diveLenValueLabel))))
            .addGroup(gl_bottomPanel.createSequentialGroup().addContainerGap().addComponent(diluentLabel)));
    bottomPanel.setLayout(gl_bottomPanel);
    chartPanel = null;
}

From source file:me.mayo.telnetkek.MainPanel.java

@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    splitPane = new javax.swing.JSplitPane();
    jPanel3 = new javax.swing.JPanel();
    mainOutputScoll = new javax.swing.JScrollPane();
    mainOutput = new javax.swing.JTextPane();
    btnDisconnect = new javax.swing.JButton();
    btnSend = new javax.swing.JButton();
    txtServer = new javax.swing.JComboBox<>();
    chkAutoScroll = new javax.swing.JCheckBox();
    txtCommand = new javax.swing.JTextField();
    btnConnect = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel2 = new javax.swing.JPanel();
    tblPlayersScroll = new javax.swing.JScrollPane();
    tblPlayers = new javax.swing.JTable();
    jLabel3 = new javax.swing.JLabel();
    txtNumPlayers = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    chkIgnorePlayerCommands = new javax.swing.JCheckBox();
    chkIgnoreServerCommands = new javax.swing.JCheckBox();
    chkShowChatOnly = new javax.swing.JCheckBox();
    chkIgnoreErrors = new javax.swing.JCheckBox();
    jPanel4 = new javax.swing.JPanel();
    favoriteButtonsPanelHolder = new javax.swing.JPanel();
    favoriteButtonsPanelScroll = new javax.swing.JScrollPane();
    favoriteButtonsPanel = new me.mayo.telnetkek.button.FavoriteButtonsPanel(favButtonList);

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("BukkitTelnetClient");

    splitPane.setBackground(new java.awt.Color(68, 68, 68));
    splitPane.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(68, 68, 68), 5));
    splitPane.setResizeWeight(1.0);/*from   ww  w . j  a v  a 2s  .  c om*/

    jPanel3.setBackground(new java.awt.Color(68, 68, 68));

    mainOutput.setEditable(false);
    mainOutput.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    mainOutput.setForeground(new java.awt.Color(255, 255, 255));
    mainOutputScoll.setViewportView(mainOutput);

    btnDisconnect.setBackground(new java.awt.Color(68, 68, 68));
    btnDisconnect.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    btnDisconnect.setText("Leave");
    btnDisconnect.setEnabled(false);
    btnDisconnect.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnDisconnectActionPerformed(evt);
        }
    });

    btnSend.setBackground(new java.awt.Color(68, 68, 68));
    btnSend.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    btnSend.setText("Send");
    btnSend.setEnabled(false);
    btnSend.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSendActionPerformed(evt);
        }
    });

    txtServer.setBackground(new java.awt.Color(91, 91, 91));
    txtServer.setEditable(true);
    txtServer.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    txtServer.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtServerActionPerformed(evt);
        }
    });

    chkAutoScroll.setBackground(new java.awt.Color(68, 68, 68));
    chkAutoScroll.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    chkAutoScroll.setForeground(new java.awt.Color(255, 255, 255));
    chkAutoScroll.setSelected(true);
    chkAutoScroll.setText("Auto Scroll");

    txtCommand.setEnabled(false);
    txtCommand.addKeyListener(new java.awt.event.KeyAdapter() {
        public void keyPressed(java.awt.event.KeyEvent evt) {
            txtCommandKeyPressed(evt);
        }
    });

    btnConnect.setBackground(new java.awt.Color(68, 68, 68));
    btnConnect.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    btnConnect.setText("Join");
    btnConnect.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnConnectActionPerformed(evt);
        }
    });

    jLabel1.setBackground(new java.awt.Color(68, 68, 68));
    jLabel1.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    jLabel1.setForeground(new java.awt.Color(255, 255, 255));
    jLabel1.setText("Command:");

    jLabel2.setBackground(new java.awt.Color(68, 68, 68));
    jLabel2.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    jLabel2.setForeground(new java.awt.Color(255, 255, 255));
    jLabel2.setText("Server:");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(mainOutputScoll)
                            .addGroup(jPanel3Layout.createSequentialGroup().addGroup(jPanel3Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel1)).addGap(18, 18, 18)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(txtCommand)
                                            .addComponent(txtServer, 0, 411, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
                                                    false)
                                            .addComponent(btnConnect, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(btnSend, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(btnDisconnect).addComponent(chkAutoScroll))))
                    .addContainerGap()));

    jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL,
            new java.awt.Component[] { btnConnect, btnDisconnect, btnSend, chkAutoScroll });

    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap()
                    .addComponent(mainOutputScoll, javax.swing.GroupLayout.DEFAULT_SIZE, 345, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtCommand, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1).addComponent(btnSend).addComponent(chkAutoScroll))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2).addComponent(btnConnect).addComponent(btnDisconnect)
                            .addComponent(txtServer, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    splitPane.setLeftComponent(jPanel3);

    jTabbedPane1.setBackground(new java.awt.Color(68, 68, 68));
    jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    jTabbedPane1.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N

    jPanel2.setBackground(new java.awt.Color(68, 68, 68));

    tblPlayers.setAutoCreateRowSorter(true);
    tblPlayers.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    tblPlayers.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    tblPlayersScroll.setViewportView(tblPlayers);
    tblPlayers.getColumnModel().getSelectionModel()
            .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

    jLabel3.setBackground(new java.awt.Color(68, 68, 68));
    jLabel3.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    jLabel3.setForeground(new java.awt.Color(255, 255, 255));
    jLabel3.setText("Number of Players:");

    txtNumPlayers.setEditable(false);
    txtNumPlayers.setBackground(new java.awt.Color(255, 255, 255));
    txtNumPlayers.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup().addComponent(jLabel3)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(txtNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 65,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(0, 0, 0)))
                    .addContainerGap()));
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addComponent(tblPlayersScroll, javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3).addComponent(txtNumPlayers,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

    jTabbedPane1.addTab("Player List", jPanel2);

    jPanel1.setBackground(new java.awt.Color(68, 68, 68));
    jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(68, 68, 68)));

    chkIgnorePlayerCommands.setBackground(new java.awt.Color(68, 68, 68));
    chkIgnorePlayerCommands.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    chkIgnorePlayerCommands.setForeground(new java.awt.Color(255, 255, 255));
    chkIgnorePlayerCommands.setSelected(true);
    chkIgnorePlayerCommands.setText("Ignore \"[PLAYER_COMMAND]\" messages");

    chkIgnoreServerCommands.setBackground(new java.awt.Color(68, 68, 68));
    chkIgnoreServerCommands.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    chkIgnoreServerCommands.setForeground(new java.awt.Color(255, 255, 255));
    chkIgnoreServerCommands.setSelected(true);
    chkIgnoreServerCommands.setText("Ignore \"issued server command\" messages");
    chkIgnoreServerCommands.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chkIgnoreServerCommandsActionPerformed(evt);
        }
    });

    chkShowChatOnly.setBackground(new java.awt.Color(68, 68, 68));
    chkShowChatOnly.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    chkShowChatOnly.setForeground(new java.awt.Color(255, 255, 255));
    chkShowChatOnly.setText("Show chat only");
    chkShowChatOnly.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chkShowChatOnlyActionPerformed(evt);
        }
    });

    chkIgnoreErrors.setBackground(new java.awt.Color(68, 68, 68));
    chkIgnoreErrors.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N
    chkIgnoreErrors.setForeground(new java.awt.Color(255, 255, 255));
    chkIgnoreErrors.setText("Ignore warnings and errors");
    chkIgnoreErrors.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            chkIgnoreErrorsActionPerformed(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkIgnorePlayerCommands).addComponent(chkIgnoreServerCommands)
                            .addComponent(chkShowChatOnly).addComponent(chkIgnoreErrors))
                    .addContainerGap(68, Short.MAX_VALUE)));
    jPanel1Layout
            .setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap()
                            .addComponent(chkIgnorePlayerCommands, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(chkIgnoreServerCommands, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(chkShowChatOnly, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(chkIgnoreErrors, javax.swing.GroupLayout.PREFERRED_SIZE, 23,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap(307, Short.MAX_VALUE)));

    jTabbedPane1.addTab("Filters", jPanel1);

    jPanel4.setBackground(new java.awt.Color(68, 68, 68));
    jPanel4.setFont(new java.awt.Font("Lucida Sans Unicode", 0, 12)); // NOI18N

    favoriteButtonsPanelHolder.setLayout(new java.awt.BorderLayout());

    favoriteButtonsPanelScroll.setBorder(null);

    favoriteButtonsPanel.setBackground(new java.awt.Color(68, 68, 68));
    favoriteButtonsPanel.setLayout(null);
    favoriteButtonsPanelScroll.setViewportView(favoriteButtonsPanel);

    favoriteButtonsPanelHolder.add(favoriteButtonsPanelScroll, java.awt.BorderLayout.CENTER);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout
            .setHorizontalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout
                            .createSequentialGroup().addGap(0, 0, 0).addComponent(favoriteButtonsPanelHolder,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, 349, Short.MAX_VALUE)
                            .addGap(0, 0, 0)));
    jPanel4Layout.setVerticalGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup().addContainerGap()
                    .addComponent(favoriteButtonsPanelHolder, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap()));

    jTabbedPane1.addTab("Commands", jPanel4);

    splitPane.setRightComponent(jTabbedPane1);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addGap(0, 0, 0).addComponent(splitPane).addGap(0, 0, 0)));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(splitPane, javax.swing.GroupLayout.Alignment.TRAILING));

    pack();
}

From source file:de.tor.tribes.ui.algo.AttackTimePanel.java

/**
 * This method is called from within the constructor to initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is always
 * regenerated by the Form Editor.// w w w . jav  a  2s .  c  o  m
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    jPanel2 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    minSendTimeField = new de.tor.tribes.ui.components.DateTimeField();
    maxArriveTimeField = new de.tor.tribes.ui.components.DateTimeField();
    jLabel3 = new javax.swing.JLabel();
    jArriveInPastLabel = new javax.swing.JLabel();
    jPanel3 = new javax.swing.JPanel();
    jSendTimeFrame = new com.visutools.nav.bislider.BiSlider();
    dateTimeField = new de.tor.tribes.ui.components.DateTimeField();
    jPanel4 = new javax.swing.JPanel();
    jAlwaysButton = new javax.swing.JRadioButton();
    jDayButton = new javax.swing.JRadioButton();
    jExactTimeButton = new javax.swing.JRadioButton();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jPanel5 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTimeFrameList = new javax.swing.JList();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();

    setLayout(new java.awt.GridBagLayout());

    jPanel2.setLayout(new java.awt.GridBagLayout());

    jLabel2.setText("Enddatum");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel2.add(jLabel2, gridBagConstraints);

    minSendTimeField.setTimeEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel2.add(minSendTimeField, gridBagConstraints);

    maxArriveTimeField.setTimeEnabled(false);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 3;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel2.add(maxArriveTimeField, gridBagConstraints);

    jLabel3.setText("Startdatum");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel2.add(jLabel3, gridBagConstraints);

    jArriveInPastLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/warning.png"))); // NOI18N
    jArriveInPastLabel.setToolTipText("Die Ankunftzeit liegt in der Vergangenheit!");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    jPanel2.add(jArriveInPastLabel, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    add(jPanel2, gridBagConstraints);

    jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Einstellungen"));

    jSendTimeFrame.setToolTipText("Zeitfenster des Zeitrahmens");

    dateTimeField.setToolTipText("Datum und Uhrzeit des Zeitrahmens");
    dateTimeField.setEnabled(false);
    dateTimeField.setTimeEnabled(false);

    jPanel4.setLayout(new java.awt.GridBagLayout());

    buttonGroup1.add(jAlwaysButton);
    jAlwaysButton.setSelected(true);
    jAlwaysButton.setText("Immer");
    jAlwaysButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/att_remove.png"))); // NOI18N
    jAlwaysButton.setRolloverEnabled(false);
    jAlwaysButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/res/month.png"))); // NOI18N
    jAlwaysButton.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireValidityStateChangedEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
    gridBagConstraints.weighty = 0.33;
    jPanel4.add(jAlwaysButton, gridBagConstraints);

    buttonGroup1.add(jDayButton);
    jDayButton.setText("Tag");
    jDayButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/att_remove.png"))); // NOI18N
    jDayButton.setRolloverEnabled(false);
    jDayButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/res/day.png"))); // NOI18N
    jDayButton.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireValidityStateChangedEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weighty = 0.33;
    jPanel4.add(jDayButton, gridBagConstraints);

    buttonGroup1.add(jExactTimeButton);
    jExactTimeButton.setText("Zeitpunkt");
    jExactTimeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/att_remove.png"))); // NOI18N
    jExactTimeButton.setRolloverEnabled(false);
    jExactTimeButton.setSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/res/date-time.png"))); // NOI18N
    jExactTimeButton.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireValidityStateChangedEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
    gridBagConstraints.weighty = 0.33;
    jPanel4.add(jExactTimeButton, gridBagConstraints);

    jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weighty = 1.0;
    jPanel4.add(jSeparator1, gridBagConstraints);

    jLabel8.setText("Datum/Zeit");

    jLabel9.setText("Zeitraum");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel9, javax.swing.GroupLayout.Alignment.LEADING,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                            Short.MAX_VALUE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup().addGap(18, 18, 18).addComponent(
                                    dateTimeField, javax.swing.GroupLayout.DEFAULT_SIZE, 372, Short.MAX_VALUE))
                            .addGroup(jPanel3Layout.createSequentialGroup().addGap(23, 23, 23).addComponent(
                                    jSendTimeFrame, javax.swing.GroupLayout.DEFAULT_SIZE, 371,
                                    Short.MAX_VALUE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel4,
                            javax.swing.GroupLayout.PREFERRED_SIZE, 97,
                            javax.swing.GroupLayout.PREFERRED_SIZE)));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING,
                                    javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
                                    Short.MAX_VALUE)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(dateTimeField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(37, 37, 37)
                                    .addGroup(jPanel3Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jSendTimeFrame,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE, 36,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap()));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    add(jPanel3, gridBagConstraints);

    jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Zeitrahmenvorschau"));

    jLabel5.setBackground(new java.awt.Color(204, 204, 204));
    jLabel5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/move_out.png"))); // NOI18N
    jLabel5.setText("Am 13.04.11, von 10 bis 24 Uhr (Alle)");
    jLabel5.setToolTipText("Abschickzeitrahmen fr die gewhlten Einstellungen");
    jLabel5.setMaximumSize(new java.awt.Dimension(230, 16));
    jLabel5.setMinimumSize(new java.awt.Dimension(230, 16));
    jLabel5.setOpaque(true);
    jLabel5.setPreferredSize(new java.awt.Dimension(230, 16));

    jLabel6.setBackground(new java.awt.Color(204, 204, 204));
    jLabel6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/move_in.png"))); // NOI18N
    jLabel6.setText("Am 13.04.11, von 10 bis 24 Uhr (Alle)");
    jLabel6.setToolTipText("Ankunftszeitrahmen fr die gewhlten Einstellungen");
    jLabel6.setMaximumSize(new java.awt.Dimension(230, 16));
    jLabel6.setMinimumSize(new java.awt.Dimension(230, 16));
    jLabel6.setOpaque(true);
    jLabel6.setPreferredSize(new java.awt.Dimension(230, 16));

    jLabel7.setBackground(new java.awt.Color(204, 204, 204));
    jLabel7.setForeground(new java.awt.Color(153, 153, 153));
    jLabel7.setText("(Passenden Zeitrahmen per Drag&Drop in die Zeitrahmenliste ziehen)");

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addContainerGap().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 271, Short.MAX_VALUE))
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap()));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel7)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    add(jPanel1, gridBagConstraints);

    jPanel5.setLayout(new java.awt.GridBagLayout());

    jScrollPane1.setBorder(javax.swing.BorderFactory.createTitledBorder("Verwendete Zeitrahmen"));
    jScrollPane1.setMinimumSize(new java.awt.Dimension(262, 60));

    jTimeFrameList.setToolTipText(
            "<html>Liste der verwendeten Zeitrahmen<br/>\nUm Zeitrahmen zu entfernen, markieren einen oder mehrere Zeitrahmen und drcke <i>Entf</i>\n</html>");
    jScrollPane1.setViewportView(jTimeFrameList);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridheight = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    jPanel5.add(jScrollPane1, gridBagConstraints);

    jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/red_x.png"))); // NOI18N
    jButton1.setToolTipText("Die gewhlten Zeitrahmen lschen");
    jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireDeleteTimeFramesEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(15, 5, 5, 5);
    jPanel5.add(jButton1, gridBagConstraints);

    jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/refresh.png"))); // NOI18N
    jButton2.setToolTipText("Alle Zeitrahmen lschen");
    jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireResetTimeFramesEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.insets = new java.awt.Insets(15, 5, 5, 5);
    jPanel5.add(jButton2, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    add(jPanel5, gridBagConstraints);
}

From source file:com.juanhg.pot.PotApplet.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);

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

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

    lblQ = new JLabel("Q:");
    lblQ.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblQValue = new JLabel();
    lblQValue.setText("-");
    lblQValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

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

    lblTOValue = new JLabel();
    lblTOValue.setText("-");
    lblTOValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblU = new JLabel("U:");
    lblU.setFont(new Font("Tahoma", Font.PLAIN, 14));

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

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

    lblVOValue = new JLabel();
    lblVOValue.setText("-");
    lblVOValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

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

    lblUValue = new JLabel();
    lblUValue.setText("-");
    lblUValue.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, 352, Short.MAX_VALUE)
            .addGroup(gl_panelOutputs.createSequentialGroup().addGap(31).addGroup(gl_panelOutputs
                    .createParallelGroup(Alignment.TRAILING)
                    .addGroup(gl_panelOutputs.createSequentialGroup()
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING, false)
                                    .addComponent(lblQ, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE,
                                            Short.MAX_VALUE)
                                    .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 43,
                                            GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(ComponentPlacement.RELATED)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblWValue, GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)
                                    .addComponent(lblQValue, GroupLayout.DEFAULT_SIZE, 90, Short.MAX_VALUE)))
                    .addGroup(Alignment.LEADING, gl_panelOutputs.createSequentialGroup()
                            .addComponent(lblT2, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblTOValue,
                                    GroupLayout.PREFERRED_SIZE, 90, GroupLayout.PREFERRED_SIZE)))
                    .addGap(18)//from   w  w w.  ja v a 2s.c  om
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblU, GroupLayout.PREFERRED_SIZE, 43,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(6).addComponent(lblUValue, GroupLayout.PREFERRED_SIZE, 90,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 43,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(6).addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 90,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(gl_panelOutputs.createSequentialGroup()
                                    .addComponent(lblVO, GroupLayout.PREFERRED_SIZE, 43,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addGap(6).addComponent(lblVOValue, GroupLayout.PREFERRED_SIZE, 90,
                                            GroupLayout.PREFERRED_SIZE)))
                    .addGap(25)));
    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.RELATED)
                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING).addGroup(gl_panelOutputs
                            .createSequentialGroup()
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblU, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblUValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(6)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblP, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblPValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGap(6)
                            .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                    .addComponent(lblVO, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblVOValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)))
                            .addGroup(gl_panelOutputs.createSequentialGroup().addGroup(gl_panelOutputs
                                    .createParallelGroup(Alignment.TRAILING)
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblW, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblQ,
                                                    GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
                                    .addGroup(gl_panelOutputs.createSequentialGroup()
                                            .addComponent(lblWValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(lblQValue,
                                                    GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelOutputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblT2, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblTOValue, GroupLayout.PREFERRED_SIZE, 17,
                                                    GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap()));
    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.LEADING)
                    .addGroup(Alignment.TRAILING, gl_panel_control.createSequentialGroup().addContainerGap()
                            .addGroup(gl_panel_control.createParallelGroup(Alignment.TRAILING)
                                    .addComponent(panelInputs, Alignment.LEADING, GroupLayout.PREFERRED_SIZE,
                                            346, Short.MAX_VALUE)
                                    .addComponent(panelOutputs, Alignment.LEADING, GroupLayout.DEFAULT_SIZE,
                                            GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 346, Short.MAX_VALUE)
                                    .addComponent(panelLicense, Alignment.LEADING, 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.DEFAULT_SIZE, 292, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panelOutputs, GroupLayout.PREFERRED_SIZE, 108, GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(panel_6, GroupLayout.PREFERRED_SIZE, 81, 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);

    lblT = new JLabel("Temperatura");
    lblT.setFont(new Font("Tahoma", Font.PLAIN, 14));

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

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

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

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

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

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

    sliderT = new JSlider();
    sliderT.setMinimum(280);
    sliderT.setMaximum(330);
    sliderT.setMinorTickSpacing(1);
    sliderT.setValue(300);
    sliderT.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent event) {
            sliderI1Event();
        }
    });

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

    sliderMo = new JSlider();
    sliderMo.setMinimum(1);
    sliderMo.setMaximum(1000);
    sliderMo.setValue(5);
    sliderMo.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI3Event();
        }
    });

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

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

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

    lblType = new JLabel("Combustible");
    lblType.setFont(new Font("Tahoma", Font.PLAIN, 14));

    lblTypeValue = new JLabel("Madera");
    lblTypeValue.setFont(new Font("Tahoma", Font.PLAIN, 14));

    sliderType = new JSlider();
    sliderType.setMinimum(1);
    sliderType.setMaximum(4);
    sliderType.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            sliderI5Event();
        }
    });
    sliderType.setValue(1);
    sliderType.setMinorTickSpacing(1);

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

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

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

    btn1 = new JButton("1");
    btn1.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent arg0) {
            btn1function();
        }
    });

    btn2 = new JButton("2");
    btn2.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            btn1.setEnabled(true);
            btn2.setEnabled(false);
            btn3.setEnabled(true);

            lblT.setEnabled(true);
            lblTValue.setEnabled(true);
            sliderT.setEnabled(true);

            lblV.setEnabled(true);
            lblVValue.setEnabled(true);
            sliderV.setEnabled(true);

            lblMo.setEnabled(false);
            lblMoValue.setEnabled(false);
            sliderMo.setEnabled(false);

            lblM.setEnabled(false);
            lblMValue.setEnabled(false);
            sliderM.setEnabled(false);

            lblType.setEnabled(true);
            lblTypeValue.setEnabled(true);
            sliderType.setEnabled(true);

            lblMc.setEnabled(true);
            lblMcValue.setEnabled(true);
            sliderMc.setEnabled(true);

            model.setCurrentPhase(2);
            readInputs();
            updateFire();
            updateScrews();
            updatePot();

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

    btn3 = new JButton("3");
    btn3.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {

            btn1.setEnabled(true);
            btn2.setEnabled(true);
            btn3.setEnabled(false);

            lblT.setEnabled(true);
            lblTValue.setEnabled(true);
            sliderT.setEnabled(true);

            lblV.setEnabled(false);
            lblVValue.setEnabled(false);
            sliderV.setEnabled(false);

            lblMo.setEnabled(false);
            lblMoValue.setEnabled(false);
            sliderMo.setEnabled(false);

            lblM.setEnabled(true);
            lblMValue.setEnabled(true);
            sliderM.setEnabled(true);

            lblType.setEnabled(true);
            lblTypeValue.setEnabled(true);
            sliderType.setEnabled(true);

            lblMc.setEnabled(true);
            lblMcValue.setEnabled(true);
            sliderMc.setEnabled(true);

            model.setCurrentPhase(3);
            readInputs();
            updateFire();
            updateScrews();
            updatePot();

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

    GroupLayout gl_panelInputs = new GroupLayout(panelInputs);
    gl_panelInputs.setHorizontalGroup(gl_panelInputs.createParallelGroup(Alignment.TRAILING)
            .addComponent(panelTitle, GroupLayout.DEFAULT_SIZE, 383, Short.MAX_VALUE)
            .addGroup(gl_panelInputs.createSequentialGroup().addGap(25)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addGroup(Alignment.TRAILING,
                            gl_panelInputs.createSequentialGroup().addGroup(gl_panelInputs
                                    .createParallelGroup(Alignment.TRAILING).addGroup(gl_panelInputs
                                            .createSequentialGroup()
                                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                                    .addComponent(lblV, GroupLayout.PREFERRED_SIZE, 120,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblMo, GroupLayout.DEFAULT_SIZE, 141,
                                                            Short.MAX_VALUE)
                                                    .addComponent(lblM, GroupLayout.PREFERRED_SIZE, 120,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblType, GroupLayout.PREFERRED_SIZE, 120,
                                                            GroupLayout.PREFERRED_SIZE)
                                                    .addComponent(lblMc, GroupLayout.PREFERRED_SIZE, 118,
                                                            GroupLayout.PREFERRED_SIZE))
                                            .addGap(18))
                                    .addComponent(lblT, GroupLayout.DEFAULT_SIZE, 159, Short.MAX_VALUE))
                                    .addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(lblTValue, GroupLayout.PREFERRED_SIZE, 42,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblMoValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 56,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblTypeValue, GroupLayout.PREFERRED_SIZE, 70,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(lblMcValue, GroupLayout.PREFERRED_SIZE, 42,
                                                    GroupLayout.PREFERRED_SIZE))
                                    .addGap(4).addPreferredGap(ComponentPlacement.RELATED)
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                                            .addComponent(sliderMc, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderType, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderM, GroupLayout.PREFERRED_SIZE, 88,
                                                    GroupLayout.PREFERRED_SIZE)
                                            .addComponent(sliderMo, GroupLayout.DEFAULT_SIZE, 109,
                                                    Short.MAX_VALUE)
                                            .addComponent(sliderV, 0, 0, Short.MAX_VALUE)
                                            .addComponent(sliderT, 0, 0, Short.MAX_VALUE)))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(btn1, GroupLayout.PREFERRED_SIZE, 94,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.UNRELATED)
                                    .addComponent(btn2, GroupLayout.PREFERRED_SIZE, 93,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(ComponentPlacement.UNRELATED).addComponent(btn3,
                                            GroupLayout.PREFERRED_SIZE, 91, GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    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(lblT)
                                    .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)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE).addComponent(lblV)
                                    .addComponent(lblVValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderV, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addGap(11)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING).addComponent(lblMo)
                            .addComponent(lblMoValue, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderMo, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblM, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblMValue, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderM, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addComponent(lblType, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
                            .addComponent(sliderType, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblTypeValue, GroupLayout.PREFERRED_SIZE, 17,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                    .addComponent(lblMcValue, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE)
                                    .addComponent(lblMc, GroupLayout.PREFERRED_SIZE, 17,
                                            GroupLayout.PREFERRED_SIZE))
                            .addComponent(sliderMc, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(ComponentPlacement.UNRELATED)
                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.LEADING)
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addComponent(btn1, GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)
                                    .addGap(12))
                            .addGroup(gl_panelInputs.createSequentialGroup()
                                    .addGroup(gl_panelInputs.createParallelGroup(Alignment.BASELINE)
                                            .addComponent(btn2, GroupLayout.DEFAULT_SIZE, 54, Short.MAX_VALUE)
                                            .addComponent(btn3, GroupLayout.DEFAULT_SIZE, 56, Short.MAX_VALUE))
                                    .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(UIManager.getColor("Button.background"));

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

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

    JPanel panel_1 = new JPanel();
    panel_1.setBounds(351, 0, 390, 568);
    panel_1.setBackground(Color.WHITE);
    panel_1.setBorder(new LineBorder(new Color(0, 0, 0)));

    JPanel panel33 = new JPanel();
    panel33.setBounds(1, 38, 388, 529);
    panel33.setBackground(Color.WHITE);

    JPanel panel_5 = new JPanel();
    panel_5.setBounds(1, 1, 388, 31);
    panel_5.setBorder(new BevelBorder(BevelBorder.RAISED, null, null, null, null));

    JLabel lblGrficas = new JLabel("Gr\u00E1ficas");
    lblGrficas.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel_5.add(lblGrficas);
    panel_visualizar.setLayout(null);

    JPanel panel32 = new JPanel();
    panel32.setBounds(1, 38, 343, 529);
    panel32.setBackground(Color.WHITE);

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

    JLabel lblSimulacion = new JLabel("Simulaci\u00F3n");
    lblSimulacion.setFont(new Font("Tahoma", Font.PLAIN, 14));
    panel_4.add(lblSimulacion);
    panel_visualizar.add(panel);
    panel.setLayout(null);
    panel.add(panel_4);
    panel.add(panel32);

    panelPot = new JPanelGrafica();
    panelPot.setBackground(Color.WHITE);
    GroupLayout gl_panel32 = new GroupLayout(panel32);
    gl_panel32.setHorizontalGroup(gl_panel32.createParallelGroup(Alignment.LEADING).addComponent(panelPot,
            GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE));
    gl_panel32.setVerticalGroup(gl_panel32.createParallelGroup(Alignment.LEADING).addComponent(panelPot,
            GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE));
    panel32.setLayout(gl_panel32);
    panel_visualizar.add(panel_1);
    panel_1.setLayout(null);
    panel_1.add(panel33);

    panelGraficas = new JPanelGrafica();
    panelGraficas.setBackground(Color.WHITE);
    GroupLayout gl_panel33 = new GroupLayout(panel33);
    gl_panel33.setHorizontalGroup(gl_panel33.createParallelGroup(Alignment.LEADING).addComponent(panelGraficas,
            GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE));
    gl_panel33.setVerticalGroup(gl_panel33.createParallelGroup(Alignment.LEADING).addComponent(panelGraficas,
            GroupLayout.DEFAULT_SIZE, 529, Short.MAX_VALUE));
    panel33.setLayout(gl_panel33);
    panel_1.add(panel_5);

    getContentPane().setLayout(groupLayout);
}

From source file:eu.ggnet.dwoss.redtape.position.PositionUpdateCask.java

/** This method is called from within the constructor to
 * initialize the form.//from  w  ww .  ja va  2  s. c o m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    preDecimalSpinner = new javax.swing.JSpinner();
    jLabel4 = new javax.swing.JLabel();
    bookingAccountBox = new javax.swing.JComboBox();
    jLabel5 = new javax.swing.JLabel();
    priceField = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    afterTaxPriceField = new javax.swing.JTextField();
    jLabel8 = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    descriptionArea = new javax.swing.JTextArea();
    jLabel9 = new javax.swing.JLabel();
    jScrollPane2 = new javax.swing.JScrollPane();
    nameArea = new javax.swing.JTextArea();
    priceSumField = new javax.swing.JTextField();
    afterTaxSumField = new javax.swing.JTextField();
    jSeparator1 = new javax.swing.JSeparator();
    jLabel6 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    postDecimalSpinner = new javax.swing.JSpinner();

    setMinimumSize(new java.awt.Dimension(328, 572));

    jLabel1.setText("Positionsname/berschrift:");

    jLabel2.setText("Positionstyp:");

    jLabel3.setText("Menge / Zeit:");
    jLabel3.setToolTipText("<html>Zeit in decimalformat <br /> z.B. 1.35 = 1 stunde 35 minuten</html>");

    preDecimalSpinner.setModel(new javax.swing.SpinnerNumberModel(1, 0, null, 1));

    org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${preDecimal}"), preDecimalSpinner,
            org.jdesktop.beansbinding.BeanProperty.create("value"), "amountBinding");
    bindingGroup.addBinding(binding);

    jLabel4.setText("Buchungskonto:");

    bookingAccountBox.setEnabled(false);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${bookingAccount}"), bookingAccountBox,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"), "bookingAccountBinding");
    binding.setSourceNullValue(null);
    bindingGroup.addBinding(binding);

    bookingAccountBox.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            bookingAccountBoxActionPerformed(evt);
        }
    });

    jLabel5.setText("Nettopreis:");

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${price}"), priceField,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "priceBinding");
    binding.setConverter(getStringConverter());
    bindingGroup.addBinding(binding);

    jLabel7.setText("Bruttopreis:");

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${price}"), afterTaxPriceField,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "afterTaxPriceBinding");
    binding.setConverter(getTaxedConverter());
    bindingGroup.addBinding(binding);

    jLabel8.setText("Beschreibung:");

    descriptionArea.setColumns(20);
    descriptionArea.setLineWrap(true);
    descriptionArea.setRows(5);
    descriptionArea.setWrapStyleWord(true);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${description}"), descriptionArea,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "positionDescriptionBinding");
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(descriptionArea);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${position.type.name}"), jLabel9,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "positionTypeBinding");
    bindingGroup.addBinding(binding);

    jScrollPane2.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);

    nameArea.setEditable(false);
    nameArea.setColumns(20);
    nameArea.setLineWrap(true);
    nameArea.setRows(5);
    nameArea.setWrapStyleWord(true);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${positionName}"), nameArea,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "nameBinding");
    bindingGroup.addBinding(binding);

    jScrollPane2.setViewportView(nameArea);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${amount * price  }"), priceSumField,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "priceSumBinding");
    binding.setConverter(getStringConverter());
    bindingGroup.addBinding(binding);

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${amount *price }"), afterTaxSumField,
            org.jdesktop.beansbinding.BeanProperty.create("text"), "afterTaxSumBinding");
    binding.setConverter(getTaxedConverter());
    bindingGroup.addBinding(binding);

    jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
    jSeparator1.setToolTipText("");

    jLabel6.setText("Summe");

    jLabel10.setText(",");

    postDecimalSpinner.setModel(new javax.swing.SpinnerNumberModel(0, 0, 75, 25));

    binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this,
            org.jdesktop.beansbinding.ELProperty.create("${postDecimal}"), postDecimalSpinner,
            org.jdesktop.beansbinding.BeanProperty.create("value"), "decimalBounding");
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
            javax.swing.GroupLayout.Alignment.TRAILING,
            layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jScrollPane1)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING,
                            layout.createSequentialGroup().addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(
                                            jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout.createParallelGroup(
                                            javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(
                                                    bookingAccountBox,
                                                    javax.swing.GroupLayout.Alignment.LEADING, 0,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout
                                                    .createSequentialGroup()
                                                    .addComponent(jLabel9, javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                            Short.MAX_VALUE)
                                                    .addGap(109, 109, 109))
                                            .addGroup(layout.createSequentialGroup()
                                                    .addComponent(preDecimalSpinner,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE, 72,
                                                            Short.MAX_VALUE)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jLabel10).addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(postDecimalSpinner,
                                                            javax.swing.GroupLayout.DEFAULT_SIZE, 53,
                                                            Short.MAX_VALUE)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                                    .addComponent(jLabel6).addGap(68, 68, 68))
                                            .addGroup(layout.createSequentialGroup()
                                                    .addGroup(layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.LEADING)
                                                            .addComponent(priceField)
                                                            .addComponent(afterTaxPriceField))
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(jSeparator1,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 6,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                            javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                                    .addGroup(layout.createParallelGroup(
                                                            javax.swing.GroupLayout.Alignment.LEADING, false)
                                                            .addComponent(priceSumField,
                                                                    javax.swing.GroupLayout.DEFAULT_SIZE, 102,
                                                                    Short.MAX_VALUE)
                                                            .addComponent(afterTaxSumField)))))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8, javax.swing.GroupLayout.Alignment.LEADING))
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addGap(4, 4, 4)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 53,
                            javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2).addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    16, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(5, 5, 5)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4).addComponent(bookingAccountBox,
                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(preDecimalSpinner, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel10)
                            .addComponent(postDecimalSpinner, javax.swing.GroupLayout.PREFERRED_SIZE,
                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6))
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel5).addComponent(priceField,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(jLabel7).addComponent(afterTaxPriceField,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(layout.createSequentialGroup().addGap(6, 6, 6).addGroup(layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addGroup(layout.createSequentialGroup()
                                            .addComponent(priceSumField, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(afterTaxSumField,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE,
                                                    javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 46,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel8)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 316, Short.MAX_VALUE)
                    .addContainerGap()));

    bindingGroup.bind();
}

From source file:SuitaDetails.java

public void initTCOptions() {
    tcoptions = new JPanel();
    tcoptions.setBackground(Color.WHITE);
    JLabel tcname = new JLabel("TC name:");
    ttcname = new JTextField();
    JLabel view = new JLabel("TC view: ");
    tview = new JTextField();
    runnable = new JCheckBox("Runnable");
    runnable.setBackground(Color.WHITE);
    optional = new JCheckBox("Optional");
    optional.setBackground(Color.WHITE);
    prerequisites = new JCheckBox("setup file");
    teardown = new JCheckBox("teardown file");
    prerequisites.setBackground(Color.WHITE);
    teardown.setBackground(Color.WHITE);
    prop = new PropPanel();
    param = new ParamPanel();

    GroupLayout layout = new GroupLayout(tcoptions);
    tcoptions.setLayout(layout);/*from   w  ww.j av  a 2s.  com*/
    layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout
                    .createParallelGroup(GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup().addComponent(prop, 0, 0, Short.MAX_VALUE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(param, 0, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup().addGroup(layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup().addComponent(runnable).addGap(18, 18, 18)
                                    .addComponent(optional).addGap(18, 18, 18).addComponent(prerequisites)
                                    .addGap(18, 18, 18).addComponent(teardown))
                            .addGroup(layout.createSequentialGroup().addComponent(tcname)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(ttcname, GroupLayout.PREFERRED_SIZE, 300,
                                            GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createSequentialGroup().addComponent(view)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(tview,
                                            GroupLayout.PREFERRED_SIZE, 300, GroupLayout.PREFERRED_SIZE)))
                            .addGap(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())));

    layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup().addContainerGap()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(tcname)
                            .addComponent(ttcname, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(view)
                            .addComponent(tview, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
                                    GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)

                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(runnable)
                            .addComponent(optional).addComponent(prerequisites).addComponent(teardown))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addComponent(prop, 0, 0, Short.MAX_VALUE)
                            .addComponent(param, 0, 0, Short.MAX_VALUE))
                    .addContainerGap()));
}

From source file:de.tor.tribes.ui.views.DSWorkbenchAttackFrame.java

/**
 * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this
 * method is always regenerated by the Form Editor.
 *//*from  ww w  . j  a v a 2 s  . c  om*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jxSearchPane = new org.jdesktop.swingx.JXPanel();
    jXPanel2 = new org.jdesktop.swingx.JXPanel();
    jButton12 = new javax.swing.JButton();
    jTextField1 = new javax.swing.JTextField();
    jLabel21 = new javax.swing.JLabel();
    jFilterRows = new javax.swing.JCheckBox();
    jFilterCaseSensitive = new javax.swing.JCheckBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jXColumnList = new org.jdesktop.swingx.JXList();
    jLabel22 = new javax.swing.JLabel();
    jXAttackPanel = new org.jdesktop.swingx.JXPanel();
    jAttackTabPane = new javax.swing.JTabbedPane();
    jNewPlanPanel = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jAttackPanel = new javax.swing.JPanel();
    jAttackFrameAlwaysOnTop = new javax.swing.JCheckBox();
    capabilityInfoPanel1 = new de.tor.tribes.ui.components.CapabilityInfoPanel();

    jxSearchPane.setOpaque(false);
    jxSearchPane.setLayout(new java.awt.GridBagLayout());

    jXPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jXPanel2.setInheritAlpha(false);

    jButton12.setText("Anwenden");
    jButton12.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireHideGlassPaneEvent(evt);
        }
    });

    jTextField1.addCaretListener(new javax.swing.event.CaretListener() {
        public void caretUpdate(javax.swing.event.CaretEvent evt) {
            fireHighlightEvent(evt);
        }
    });

    jLabel21.setText("Suchbegriff");

    jFilterRows.setText("Nur gefilterte Zeilen anzeigen");
    jFilterRows.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireUpdateFilterEvent(evt);
        }
    });

    jFilterCaseSensitive.setText("Gro-/Kleinschreibung beachten");
    jFilterCaseSensitive.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireUpdateFilterEvent(evt);
        }
    });

    jXColumnList.setModel(new javax.swing.AbstractListModel() {
        String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };

        public int getSize() {
            return strings.length;
        }

        public Object getElementAt(int i) {
            return strings[i];
        }
    });
    jXColumnList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
    jScrollPane1.setViewportView(jXColumnList);

    jLabel22.setText("Spalten");

    javax.swing.GroupLayout jXPanel2Layout = new javax.swing.GroupLayout(jXPanel2);
    jXPanel2.setLayout(jXPanel2Layout);
    jXPanel2Layout
            .setHorizontalGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
                            jXPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(
                                            jLabel21, javax.swing.GroupLayout.DEFAULT_SIZE,
                                            javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                    .addGap(18, 18, 18)
                                    .addGroup(jXPanel2Layout
                                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(jXPanel2Layout.createSequentialGroup()
                                                    .addComponent(jScrollPane1,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE, 158,
                                                            javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18)
                                                    .addGroup(jXPanel2Layout
                                                            .createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING)
                                                            .addGroup(jXPanel2Layout.createParallelGroup(
                                                                    javax.swing.GroupLayout.Alignment.TRAILING,
                                                                    false)
                                                                    .addComponent(jFilterRows,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE)
                                                                    .addComponent(jFilterCaseSensitive,
                                                                            javax.swing.GroupLayout.Alignment.LEADING,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            javax.swing.GroupLayout.DEFAULT_SIZE,
                                                                            Short.MAX_VALUE))
                                                            .addComponent(jButton12)))
                                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                                                    355, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jXPanel2Layout.setVerticalGroup(jXPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jXPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jXPanel2Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel21)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jXPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jXPanel2Layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jXPanel2Layout
                                            .createSequentialGroup().addComponent(jFilterCaseSensitive)
                                            .addPreferredGap(
                                                    javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jFilterRows)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                    javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                            .addComponent(jButton12))
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING,
                                            javax.swing.GroupLayout.PREFERRED_SIZE, 164,
                                            javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel22))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jxSearchPane.add(jXPanel2, new java.awt.GridBagConstraints());

    jXAttackPanel.setLayout(new java.awt.BorderLayout());
    jXAttackPanel.add(jAttackTabPane, java.awt.BorderLayout.CENTER);

    jNewPlanPanel.setOpaque(false);
    jNewPlanPanel.setLayout(new java.awt.BorderLayout());

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/res/ui/document_new_24x24.png"))); // NOI18N
    jLabel1.setToolTipText("Leeren Plan erstellen");
    jLabel1.setEnabled(false);
    jLabel1.setMaximumSize(new java.awt.Dimension(40, 40));
    jLabel1.setMinimumSize(new java.awt.Dimension(40, 40));
    jLabel1.setPreferredSize(new java.awt.Dimension(40, 40));
    jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
        public void mouseEntered(java.awt.event.MouseEvent evt) {
            fireEnterEvent(evt);
        }

        public void mouseExited(java.awt.event.MouseEvent evt) {
            fireMouseExitEvent(evt);
        }

        public void mouseReleased(java.awt.event.MouseEvent evt) {
            fireCreateAttackPlanEvent(evt);
        }
    });
    jNewPlanPanel.add(jLabel1, java.awt.BorderLayout.CENTER);

    setTitle("Befehle");
    setMinimumSize(new java.awt.Dimension(700, 500));
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jAttackPanel.setBackground(new java.awt.Color(239, 235, 223));
    jAttackPanel.setPreferredSize(new java.awt.Dimension(700, 500));
    jAttackPanel.setLayout(new java.awt.BorderLayout());
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    getContentPane().add(jAttackPanel, gridBagConstraints);

    jAttackFrameAlwaysOnTop.setText("Immer im Vordergrund");
    jAttackFrameAlwaysOnTop.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            fireAttackFrameAlwaysOnTopEvent(evt);
        }
    });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(jAttackFrameAlwaysOnTop, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 5);
    getContentPane().add(capabilityInfoPanel1, gridBagConstraints);

    pack();
}

From source file:com.floreantpos.ui.model.MenuItemForm.java

/** This method is called from within the constructor to
 * initialize the form.//from  www.j  ava  2s .  c o  m
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
    lblStockCount = new JLabel(Messages.getString("MenuItemForm.17")); //$NON-NLS-1$
    tfStockCount = new DoubleTextField(1);
    cbDisableStockCount = new JCheckBox(Messages.getString("MenuItemForm.18")); //$NON-NLS-1$
    lblButtonColor = new JLabel(Messages.getString("MenuItemForm.19")); //$NON-NLS-1$
    tabbedPane = new javax.swing.JTabbedPane();
    tabGeneral = new javax.swing.JPanel();
    lfname = new javax.swing.JLabel();
    lfname.setHorizontalAlignment(SwingConstants.TRAILING);
    tfName = new com.floreantpos.swing.FixedLengthTextField(20);
    lgroup = new javax.swing.JLabel();
    lgroup.setHorizontalAlignment(SwingConstants.TRAILING);
    cbGroup = new javax.swing.JComboBox();
    cbGroup.setPreferredSize(new Dimension(198, 0));
    btnNewGroup = new javax.swing.JButton();
    lblPrice = new javax.swing.JLabel();
    lblPrice.setHorizontalAlignment(SwingConstants.TRAILING);
    tfPrice = new DoubleTextField(20);
    tfPrice.setHorizontalAlignment(javax.swing.JTextField.RIGHT);
    tfDescription = new JTextArea(new FixedLengthDocument(255));

    //tfDescription.setDocument(;
    tfUnitName = new FixedLengthTextField(20);
    lTax = new javax.swing.JLabel();
    lTax.setHorizontalAlignment(SwingConstants.TRAILING);
    cbTax = new javax.swing.JComboBox();
    btnNewTax = new javax.swing.JButton();
    lDiscountRate = new javax.swing.JLabel();
    lDiscountRate.setHorizontalAlignment(SwingConstants.TRAILING);
    lPercentage = new javax.swing.JLabel();
    tfDiscountRate = new DoubleTextField(18);
    tfDiscountRate.setHorizontalAlignment(SwingConstants.TRAILING);
    chkVisible = new javax.swing.JCheckBox();
    tabModifier = new javax.swing.JPanel();
    btnNewModifierGroup = new javax.swing.JButton();
    btnDeleteModifierGroup = new javax.swing.JButton();
    btnEditModifierGroup = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableTicketItemModifierGroups = new javax.swing.JTable();
    tabShift = new javax.swing.JPanel();
    tabPrice = new javax.swing.JPanel();
    tabButtonStyle = new javax.swing.JPanel();
    btnDeleteShift = new javax.swing.JButton();
    btnAddShift = new javax.swing.JButton();
    btnNewPrice = new javax.swing.JButton();
    btnUpdatePrice = new javax.swing.JButton();
    btnDeletePrice = new javax.swing.JButton();
    btnDeleteAll = new javax.swing.JButton();
    btnDefaultValue = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    jScrollPane3 = new javax.swing.JScrollPane();
    shiftTable = new javax.swing.JTable();
    priceTable = new javax.swing.JTable();
    cbPrinterGroup = new JComboBox<PrinterGroup>(new DefaultComboBoxModel<PrinterGroup>(
            PrinterGroupDAO.getInstance().findAll().toArray(new PrinterGroup[0])));
    cbPrinterGroup.setPreferredSize(new Dimension(226, 0));

    tfTranslatedName = new FixedLengthTextField(20);
    tfTranslatedName.setLength(120);

    lblUnitName = new JLabel(Messages.getString("MenuItemForm.23")); //$NON-NLS-1$
    lblKitchenPrinter = new JLabel(Messages.getString("MenuItemForm.27")); //$NON-NLS-1$
    lgroup.setText(Messages.getString("LABEL_GROUP")); //$NON-NLS-1$
    lfname.setText(Messages.getString("LABEL_NAME")); //$NON-NLS-1$
    tfName.setLength(120);
    lblTranslatedName = new JLabel(Messages.getString("MenuItemForm.lblTranslatedName.text")); //$NON-NLS-1$
    tfBarcode = new FixedLengthTextField(20);
    tfSortOrder = new IntegerTextField(20);
    lblSortOrder = new JLabel(Messages.getString("MenuItemForm.lblSortOrder.text")); //$NON-NLS-1$
    tfSortOrder.setText(""); //$NON-NLS-1$
    lblBarcode = new JLabel(Messages.getString("MenuItemForm.lblBarcode.text")); //$NON-NLS-1$
    cbTax.setPreferredSize(new Dimension(198, 0));
    ///lblButtonColor = new JLabel(Messages.getString("MenuItemForm.lblButtonColor.text")); //$NON-NLS-1$
    btnButtonColor = new JButton(); //$NON-NLS-1$
    btnButtonColor.setPreferredSize(new Dimension(228, 40));
    lblTextColor = new JLabel(Messages.getString("MenuItemForm.lblTextColor.text")); //$NON-NLS-1$
    btnTextColor = new JButton(Messages.getString("MenuItemForm.SAMPLE_TEXT")); //$NON-NLS-1$
    //   btnTextColor.setPreferredSize(new Dimension(228, 40));
    cbShowTextWithImage = new JCheckBox(Messages.getString("MenuItemForm.40")); //$NON-NLS-1$
    cbShowTextWithImage.setActionCommand(Messages.getString("MenuItemForm.41")); //$NON-NLS-1$
    lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$
    btnNewTax.setText("..."); //$NON-NLS-1$
    cbFractionalUnit = new JCheckBox(Messages.getString("MenuItemForm.24")); //$NON-NLS-1$

    btnNewGroup.setText("..."); //$NON-NLS-1$
    btnNewGroup.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            doCreateNewGroup(evt);
        }
    });

    if (Application.getInstance().isPriceIncludesTax()) {
        lblPrice.setText(Messages.getString("LABEL_SALES_PRICE_INCLUDING_TAX")); //$NON-NLS-1$
    } else {
        lblPrice.setText(Messages.getString("LABEL_SALES_PRICE_EXCLUDING_TAX")); //$NON-NLS-1$
    }

    tfPrice.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

    lTax.setText(Messages.getString("LABEL_TAX")); //$NON-NLS-1$

    btnNewTax.setText("..."); //$NON-NLS-1$
    btnNewTax.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnNewTaxdoCreateNewTax(evt);
        }
    });

    lDiscountRate.setText(com.floreantpos.POSConstants.DISCOUNT_RATE + ":"); //$NON-NLS-1$

    lPercentage.setText("%"); //$NON-NLS-1$

    chkVisible.setText(com.floreantpos.POSConstants.VISIBLE);
    chkVisible.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
    chkVisible.setMargin(new java.awt.Insets(0, 0, 0, 0));
    tabbedPane.addTab(com.floreantpos.POSConstants.GENERAL, tabGeneral);
    tabbedPane.setPreferredSize(new Dimension(750, 470));

    btnNewModifierGroup.setText(com.floreantpos.POSConstants.ADD);
    btnNewModifierGroup.setActionCommand("AddModifierGroup"); //$NON-NLS-1$
    btnNewModifierGroup.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnNewModifierGroupActionPerformed(evt);
        }
    });

    btnDeleteModifierGroup.setText(com.floreantpos.POSConstants.DELETE);
    btnDeleteModifierGroup.setActionCommand("DeleteModifierGroup"); //$NON-NLS-1$

    btnEditModifierGroup.setText(com.floreantpos.POSConstants.EDIT);
    btnEditModifierGroup.setActionCommand("EditModifierGroup"); //$NON-NLS-1$

    menuItemMGListModel = new MenuItemMGListModel();
    tableTicketItemModifierGroups.setModel(menuItemMGListModel);

    btnNewModifierGroup.addActionListener(this);
    btnEditModifierGroup.addActionListener(this);
    btnDeleteModifierGroup.addActionListener(this);
    btnAddShift.addActionListener(this);
    btnDeleteShift.addActionListener(this);

    tfDiscountRate.setDocument(new DoubleDocument());

    tabGeneral.setLayout(new MigLayout("insets 20", "[][]20px[][]", "[][][][][][][][][][][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    /*JLabel lblImage = new JLabel(Messages.getString("MenuItemForm.28")); //$NON-NLS-1$
    lblImage.setHorizontalAlignment(SwingConstants.TRAILING);
    tabGeneral.add(lblImage, "cell 0 0,right"); //$NON-NLS-1$
            
    lblImagePreview = new JLabel(""); //$NON-NLS-1$
    lblImagePreview.setHorizontalAlignment(JLabel.CENTER);
    lblImagePreview.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    lblImagePreview.setPreferredSize(new Dimension(100, 100));
    tabGeneral.add(lblImagePreview, "cell 1 0"); //$NON-NLS-1$
            
    JButton btnSelectImage = new JButton("..."); //$NON-NLS-1$
    btnSelectImage.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
    doSelectImageFile();
       }
    });
    tabGeneral.add(btnSelectImage, "cell 1 0"); //$NON-NLS-1$
            
    btnClearImage = new JButton(Messages.getString("MenuItemForm.34")); //$NON-NLS-1$
    btnClearImage.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e) {
    doClearImage();
       }
    });
    tabGeneral.add(btnClearImage, "cell 1 0"); //$NON-NLS-1$
    */

    tabGeneral.add(lfname, "cell 0 1 ,right"); //$NON-NLS-1$
    tabGeneral.add(tfName, "cell 1 1,grow"); //$NON-NLS-1$

    tabGeneral.add(lblTranslatedName, "cell 0 2,right"); //$NON-NLS-1$
    tabGeneral.add(tfTranslatedName, "cell 1 2,grow"); //$NON-NLS-1$

    /*tabGeneral.add(new JLabel("Description"), "cell 0 3,right");
    JScrollPane scrlDescription = new JScrollPane(tfDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    tabGeneral.add(scrlDescription, "cell 1 3");*/

    tabGeneral.add(lblUnitName, "cell 0 3,right"); //$NON-NLS-1$
    tabGeneral.add(tfUnitName, "cell 1 3,grow"); //$NON-NLS-1$
    JLabel lblBuyPrice = new JLabel(Messages.getString("LABEL_BUY_PRICE")); //$NON-NLS-1$

    tabGeneral.add(lblBuyPrice, "cell 0 4,alignx right"); //$NON-NLS-1$
    tfBuyPrice = new DoubleTextField(20);
    tfBuyPrice.setHorizontalAlignment(SwingConstants.TRAILING);
    tabGeneral.add(tfBuyPrice, "cell 1 4,grow"); //$NON-NLS-1$

    tabGeneral.add(lblPrice, "cell 0 5,alignx right"); //$NON-NLS-1$
    tabGeneral.add(tfPrice, "cell 1 5,grow"); //$NON-NLS-1$

    tabGeneral.add(lgroup, "cell 0 6,alignx right"); //$NON-NLS-1$
    tabGeneral.add(cbGroup, "cell 1 6"); //$NON-NLS-1$
    tabGeneral.add(btnNewGroup, "cell 1 6"); //$NON-NLS-1$

    tabGeneral.add(lblBarcode, "cell 0 7,alignx right"); //$NON-NLS-1$
    tabGeneral.add(tfBarcode, "cell 1 7,grow"); //$NON-NLS-1$

    tabGeneral.add(lblSortOrder, "cell 0 8,alignx right"); //$NON-NLS-1$
    tabGeneral.add(tfSortOrder, "cell 1 8,grow"); //$NON-NLS-1$

    tabGeneral.add(lblStockCount, "cell 0 9,alignx right"); //$NON-NLS-1$
    tabGeneral.add(tfStockCount, "cell 1 9,grow"); //$NON-NLS-1$

    //tabGeneral.add(cbShowTextWithImage, "cell 1 8"); //$NON-NLS-1$
    tabGeneral.add(chkVisible, "cell 1 10"); //$NON-NLS-1$
    tabGeneral.add(cbFractionalUnit, "cell 1 11"); //$NON-NLS-1$
    tabGeneral.add(cbDisableStockCount, "cell 1 12"); //$NON-NLS-1$

    // right side

    tabGeneral.add(lblKitchenPrinter, "cell 2 1,right"); //$NON-NLS-1$
    tabGeneral.add(cbPrinterGroup, "cell 3 1,grow"); //$NON-NLS-1$

    tabGeneral.add(lTax, "cell 2 2,right"); //$NON-NLS-1$
    tabGeneral.add(cbTax, "cell 3 2"); //$NON-NLS-1$
    tabGeneral.add(btnNewTax, "cell 3 2,grow"); //$NON-NLS-1$

    /*tabGeneral.add(lblButtonColor, "cell 2 3,right"); //$NON-NLS-1$
    tabGeneral.add(btnButtonColor, "cell 3 3,grow"); //$NON-NLS-1$
            
    tabGeneral.add(lblTextColor, "cell 2 4,right"); //$NON-NLS-1$
    tabGeneral.add(btnTextColor, "cell 3 4 3 5"); //$NON-NLS-1$
    btnTextColor.setPreferredSize(new Dimension(228, 50));*/

    tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.25")), "cell 2 3,,aligny top,alignx right"); //$NON-NLS-1$ //$NON-NLS-2$
    orderList = new CheckBoxList();

    List<OrderType> orderTypes = Application.getInstance().getOrderTypes();
    orderList.setModel(orderTypes);
    //      List<String> orderListM = new ArrayList();
    //      orderListM.add(OrderType.DINE_IN.toString());
    //      orderListM.add(OrderType.BAR_TAB.toString());
    //      orderListM.add(OrderType.DRIVE_THRU.toString());
    //      orderListM.add(OrderType.HOME_DELIVERY.toString());
    //      orderListM.add(OrderType.PICKUP.toString());
    //      orderListM.add(OrderType.RETAIL.toString());
    //      orderListM.add(OrderType.TAKE_OUT.toString());

    //      orderList.setModel(orderListM);

    JScrollPane orderCheckBoxList = new JScrollPane(orderList);
    orderCheckBoxList.setPreferredSize(new Dimension(228, 100));
    tabGeneral.add(orderCheckBoxList, "cell 3 3 3 4"); //$NON-NLS-1$
    tfDescription.setWrapStyleWord(true);
    tfDescription.setLineWrap(true);

    tabGeneral.add(new JLabel(Messages.getString("MenuItemForm.29")), "cell 2 7,aligny top,alignx right"); //$NON-NLS-1$ //$NON-NLS-2$
    JScrollPane scrlDescription = new JScrollPane(tfDescription, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
            JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    scrlDescription.setPreferredSize(new Dimension(228, 90));
    tabGeneral.add(scrlDescription, "cell 3 7 3 4"); //$NON-NLS-1$

    add(tabbedPane);
    //TODO: 
    addRecepieExtension();

    /*btnButtonColor.addActionListener(new ActionListener() {
       @Override
       public void actionPerformed(ActionEvent e) {
    Color color = JColorChooser.showDialog(MenuItemForm.this, Messages.getString("MenuItemForm.42"), btnButtonColor.getBackground()); //$NON-NLS-1$
    btnButtonColor.setBackground(color);
    btnTextColor.setBackground(color);
       }
    });
            
    btnTextColor.addActionListener(new ActionListener() {
       @Override
       public void actionPerformed(ActionEvent e) {
    Color color = JColorChooser.showDialog(MenuItemForm.this, Messages.getString("MenuItemForm.43"), btnTextColor.getForeground()); //$NON-NLS-1$
    btnTextColor.setForeground(color);
       }
    });*/

    jScrollPane1.setViewportView(tableTicketItemModifierGroups);

    GroupLayout jPanel2Layout = new GroupLayout(tabModifier);
    jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(Alignment.TRAILING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap()
                    .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 412, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addGroup(jPanel2Layout.createParallelGroup(Alignment.BASELINE)
                            .addComponent(btnDeleteModifierGroup).addComponent(btnEditModifierGroup)
                            .addComponent(btnNewModifierGroup))
                    .addContainerGap()));
    jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(Alignment.TRAILING)
            .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap().addGroup(jPanel2Layout
                    .createParallelGroup(Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup().addComponent(btnNewModifierGroup)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnEditModifierGroup)
                            .addPreferredGap(ComponentPlacement.RELATED).addComponent(btnDeleteModifierGroup))
                    .addComponent(jScrollPane1, GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE))
                    .addContainerGap()));
    tabModifier.setLayout(jPanel2Layout);

    tabbedPane.addTab(com.floreantpos.POSConstants.MODIFIER_GROUPS, tabModifier);

    btnDeleteShift.setText(com.floreantpos.POSConstants.DELETE_SHIFT);

    btnAddShift.setText(com.floreantpos.POSConstants.ADD_SHIFT);

    shiftTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
    jScrollPane2.setViewportView(shiftTable);

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(tabShift);
    tabShift.setLayout(jPanel3Layout);
    jPanel3Layout
            .setHorizontalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel3Layout.createSequentialGroup().addContainerGap(76, Short.MAX_VALUE)
                            .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jScrollPane2,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 670,
                                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(org.jdesktop.layout.GroupLayout.TRAILING,
                                            jPanel3Layout.createSequentialGroup().add(btnAddShift).add(5, 5, 5)
                                                    .add(btnDeleteShift)))
                            .addContainerGap()));
    jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 345,
                            org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(btnAddShift).add(btnDeleteShift))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    tabbedPane.addTab(com.floreantpos.POSConstants.SHIFTS, tabShift);

    //

    btnNewPrice.setText(Messages.getString("MenuItemForm.9")); //$NON-NLS-1$
    btnNewPrice.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            addNewPrice();
        }
    });
    btnUpdatePrice.setText(Messages.getString("MenuItemForm.13")); //$NON-NLS-1$
    btnUpdatePrice.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            updatePrice();
        }
    });
    btnDeletePrice.setText(Messages.getString("MenuItemForm.14")); //$NON-NLS-1$
    btnDeletePrice.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            deletePrice();
        }
    });
    btnDeleteAll.setText(Messages.getString("MenuItemForm.15")); //$NON-NLS-1$
    btnDeleteAll.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            deleteAll();
        }
    });

    btnDefaultValue.setText(Messages.getString("MenuItemForm.7")); //$NON-NLS-1$
    /*btnDefaultValue.addActionListener(new ActionListener() {
            
       @Override
       public void actionPerformed(ActionEvent e) {
    setDefaultValue();
       }
    });*/
    priceTable
            .setModel(new javax.swing.table.DefaultTableModel(
                    new Object[][] { { null, null, null, null }, { null, null, null, null },
                            { null, null, null, null }, { null, null, null, null } },
                    new String[] { "Title 1", "Title 2", "Title 3", "Title 4" })); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$

    jScrollPane3.setViewportView(priceTable);

    tabPrice.setLayout(new BorderLayout());
    tabPrice.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
    tabPrice.add(jScrollPane3, BorderLayout.CENTER);

    JPanel buttonPanel = new JPanel();

    buttonPanel.add(btnNewPrice);
    buttonPanel.add(btnUpdatePrice);
    //buttonPanel.add(btnDefaultValue);
    buttonPanel.add(btnDeletePrice);

    //   buttonPanel.add(btnDeleteAll);

    tabPrice.add(buttonPanel, BorderLayout.SOUTH);
    tabbedPane.addTab(Messages.getString("MenuItemForm.16"), tabPrice); //$NON-NLS-1$

    //

    tabbedPane.addChangeListener(this);
    //

    tabButtonStyle.setLayout(new MigLayout("insets 10", "[][]100[][][][]", "[][][center][][][]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    JLabel lblImage = new JLabel(Messages.getString("MenuItemForm.28")); //$NON-NLS-1$
    lblImage.setHorizontalAlignment(SwingConstants.TRAILING);
    tabButtonStyle.add(lblImage, "cell 0 0,right"); //$NON-NLS-1$

    lblImagePreview = new JLabel(""); //$NON-NLS-1$
    lblImagePreview.setHorizontalAlignment(JLabel.CENTER);
    lblImagePreview.setBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null));
    lblImagePreview.setPreferredSize(new Dimension(100, 100));
    tabButtonStyle.add(lblImagePreview, "cell 1 0"); //$NON-NLS-1$

    JButton btnSelectImage = new JButton("..."); //$NON-NLS-1$
    btnClearImage = new JButton(Messages.getString("MenuItemForm.34")); //$NON-NLS-1$
    tabButtonStyle.add(btnClearImage, "cell  1 0"); //$NON-NLS-1$
    tabButtonStyle.add(btnSelectImage, "cell 1 0"); //$NON-NLS-1$

    tabButtonStyle.add(lblButtonColor, "cell 0 2,right"); //$NON-NLS-1$
    tabButtonStyle.add(btnButtonColor, "cell 1 2,grow"); //$NON-NLS-1$
    tabButtonStyle.add(lblTextColor, "cell 0 3,right"); //$NON-NLS-1$
    tabButtonStyle.add(btnTextColor, "cell 1 3"); //$NON-NLS-1$
    tabButtonStyle.add(cbShowTextWithImage, "cell 1 4"); //$NON-NLS-1$

    /*   tabButtonStyle.add(lblImagePreview, "cell 3 0 3 4"); //$NON-NLS-1$
       tabButtonStyle.add(btnClearImage, "cell 3 0,gaptop 40"); //$NON-NLS-1$
       tabButtonStyle.add(btnSelectImage, "cell 3 0,gaptop 40"); //$NON-NLS-1$
       tabButtonStyle.add(lblImage, "cell 2 0,gaptop 40"); //$NON-NLS-1$
       tabButtonStyle.add(lblButtonColor, "cell 0 0,right"); //$NON-NLS-1$
       tabButtonStyle.add(btnButtonColor, "cell 1 0,grow"); //$NON-NLS-1$
       tabButtonStyle.add(lblTextColor, "cell 0 1,right"); //$NON-NLS-1$
       tabButtonStyle.add(btnTextColor, "cell 1 1"); //$NON-NLS-1$
    */
    btnTextColor.setPreferredSize(new Dimension(228, 50));

    btnSelectImage.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            doSelectImageFile();
        }
    });

    btnClearImage.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            doClearImage();
        }
    });

    btnButtonColor.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Color color = JColorChooser.showDialog(MenuItemForm.this, Messages.getString("MenuItemForm.42"), //$NON-NLS-1$
                    btnButtonColor.getBackground());
            btnButtonColor.setBackground(color);
            btnTextColor.setBackground(color);
        }
    });

    btnTextColor.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            Color color = JColorChooser.showDialog(MenuItemForm.this, Messages.getString("MenuItemForm.43"), //$NON-NLS-1$
                    btnTextColor.getForeground());
            btnTextColor.setForeground(color);
        }
    });

    tabbedPane.addTab(Messages.getString("MenuItemForm.26"), tabButtonStyle); //$NON-NLS-1$

}