package main;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import static javax.swing.GroupLayout.Alignment.CENTER;

public class NewStandWindow extends JDialog{

    private JLabel lblCodigo;
    private JTextField edtCodigo;
    private JButton btnNext;

    private JButton btnOk;
    private JButton btnCancel;

    public NewStandWindow(JFrame parent){
        super(parent);

        setModal(true);

        lblCodigo = new JLabel("Código:");
        edtCodigo = new JTextField();
        edtCodigo.setPreferredSize(new Dimension(80, 24));
        btnNext = new JButton("Próximo");
        btnNext.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                onSelectNext();
            }
        });

        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setAutoCreateGaps(true);
        layout.setAutoCreateContainerGaps(true);

        layout.setHorizontalGroup(
            layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(lblCodigo)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(edtCodigo, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnNext)
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        layout.setVerticalGroup(
            layout.createSequentialGroup()
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(CENTER)
                        .addComponent(lblCodigo)
                        .addComponent(edtCodigo, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(btnNext)
                )
                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

        );

        setMinimumSize(new Dimension(320, 160));

        pack();

        setTitle("Nova bancada");
        setLocationRelativeTo(null);
        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
        setResizable(false);

    }

    public String showDialog(){
        setVisible(true);
        return edtCodigo.getText();
    }

    /*
     * 3x - numero de serie (12 bits | 4096)
     * 2x - sensores        ( 8 bits | 8 sensores)
     *      1   - Iluminacao
     *      2   - Temperatura
     *      4   - Nivel da Agua
     *      8   - pH
     *      16  - OD
     *      32  -
     *      64  -
     *      128 -
     * 2x - atuadores       ( 8 bits | 8 atuadores)
     *      1   -
     *      2   -
     *      4   -
     *      8   -
     *      16  -
     *      32  -
     *      64  -
     *      128 -
    */

    private void onSelectNext() {
        String str = edtCodigo.getText();

    }

}

@@ -313,20 +313,25 @@
 tton btn
-Next
+Configure
 ;%0A%0A    p
@@ -626,20 +626,25 @@
      btn
-Next
+Configure
  = new J
@@ -655,15 +655,18 @@
 on(%22
-Pr%C3%B3ximo
+Configurar
 %22);%0A
@@ -676,20 +676,25 @@
      btn
-Next
+Configure
 .addActi
@@ -1690,36 +1690,41 @@
 addComponent(btn
-Next
+Configure
 )%0A              
@@ -2313,20 +2313,25 @@
 nent(btn
-Next
+Configure
 )%0A      
@@ -2854,25 +2854,25 @@
 096)%0A     * 
-2
+3
 x - sensores
@@ -2880,26 +2880,26 @@
        (
- 8
+12
  bits %7C 
 8 sensor
@@ -2890,17 +2890,18 @@
  bits %7C 
-8
+12
  sensore
@@ -2923,33 +2923,252 @@
 1   
+ 
 - 
-Iluminacao%0A     *      
+pH%0A     *      2    - DO - Oxigenio dissolvido%0A     *      4    - EC - Eletrocondutividade%0A     *      8    - ORP - Potencial de oxidacao-reducao%0A     *      16   - Fluxo de agua (quanto foi gasto - diferenca nas duas leituras)%0A     *      3
 2   
@@ -3180,16 +3180,24 @@
 peratura
+ da agua
 %0A     * 
@@ -3197,24 +3197,25 @@
      *      
+6
 4   - Nivel 
@@ -3217,17 +3217,17 @@
 ivel da 
-A
+a
 gua%0A    
@@ -3238,16 +3238,35 @@
     
+12
 8
- 
   - 
-pH
+Temperatura ambiente
 %0A   
@@ -3278,16 +3278,31 @@
     
-16
+264
   - 
-OD
+Umidade ambiente
 %0A   
@@ -3302,37 +3302,51 @@
 nte%0A     *      
-3
+51
 2  -
+ Luz ambiente
 %0A     *      64 
@@ -3334,35 +3334,36 @@
 nte%0A     *      
-64 
+1024
  -%0A     *      1
@@ -3353,34 +3353,35 @@
 4 -%0A     *      
-1
 2
+04
 8 -%0A     * 2x - 
@@ -3436,17 +3436,24 @@
     1   
--
+ - Motor
 %0A     * 
@@ -3461,17 +3461,23 @@
     2   
--
+ - LEDs
 %0A     * 
@@ -3485,16 +3485,17 @@
     4   
+ 
 -%0A     *
@@ -3504,16 +3504,17 @@
     8   
+ 
 -%0A     *
@@ -3523,16 +3523,17 @@
     16  
+ 
 -%0A     *
@@ -3542,16 +3542,17 @@
     32  
+ 
 -%0A     *
@@ -3561,16 +3561,17 @@
     64  
+ 
 -%0A     *
@@ -3580,16 +3580,17 @@
     128 
+ 
 -%0A    */

Add we