package ufradvanced;

import com.sun.jna.ptr.ShortByReference;
import com.sun.jna.ptr.IntByReference;
import javax.swing.JOptionPane;

public class frmValueBlockReadWrite extends javax.swing.JInternalFrame {

    public frmValueBlockReadWrite() {
        initComponents();
    }
    
    static final int 
         FUNCT_LIGHT_OK     = 4,
         FUNCT_SOUND_OK     = 0,//4 Tripple sound
         FUNCT_LIGHT_ERROR  = 2,
         FUNCT_SOUND_ERROR  = 0,//2 Long sound
         DL_OK              = 0;
    
     static final byte
         MIFARE_AUTHENT1A   = 0x60,  
         MIFARE_AUTHENT1B   = 0x61;
     
    final static String ANY_DATA           = "You must enter any data !",
                        APPROPRIATE_FORMAT = "You must enter the appropriate format !";

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

        btngAUTH1AB = new javax.swing.ButtonGroup();
        pnlHeader = new javax.swing.JPanel();
        rbAUTH1A = new javax.swing.JRadioButton();
        rbAUTH1B = new javax.swing.JRadioButton();
        lblKeyIndex = new javax.swing.JLabel();
        cboKeyIndex = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        pgValueBlockReadWrite = new javax.swing.JTabbedPane();
        tabValueBlockRead = new javax.swing.JPanel();
        pnlValueBlockRead = new javax.swing.JPanel();
        txtVBRBlockAddress = new javax.swing.JTextField();
        btnVBRBlockRead = new javax.swing.JButton();
        lblValueBlockRead = new javax.swing.JLabel();
        lblVBRBlockAddress = new javax.swing.JLabel();
        txtValueBlockRead = new javax.swing.JTextField();
        lblReadValue = new javax.swing.JLabel();
        lblValueAddress = new javax.swing.JLabel();
        txtValueAddress = new javax.swing.JTextField();
        pnlValueBlockReadAKM1 = new javax.swing.JPanel();
        txtVBRBlockAddressAKM1 = new javax.swing.JTextField();
        btnVBRBlockReadAKM1 = new javax.swing.JButton();
        lblValueBlockReadAKM1 = new javax.swing.JLabel();
        lblVBRBlockAddressAKM1 = new javax.swing.JLabel();
        txtValueBlockReadAKM1 = new javax.swing.JTextField();
        lblReadValueAKM1 = new javax.swing.JLabel();
        lblValueAddressAKM1 = new javax.swing.JLabel();
        txtValueAddressAKM1 = new javax.swing.JTextField();
        pnlValueBlockReadAKM2 = new javax.swing.JPanel();
        txtVBRBlockAddressAKM2 = new javax.swing.JTextField();
        btnVBRBlockReadAKM2 = new javax.swing.JButton();
        lblValueBlockReadAKM2 = new javax.swing.JLabel();
        lblVBRBlockAddressAKM2 = new javax.swing.JLabel();
        txtValueBlockReadAKM2 = new javax.swing.JTextField();
        lblReadValueAKM2 = new javax.swing.JLabel();
        lblValueAddressAKM2 = new javax.swing.JLabel();
        txtValueAddressAKM2 = new javax.swing.JTextField();
        pnlValueBlockReadPK = new javax.swing.JPanel();
        txtVBRBlockAddressPK = new javax.swing.JTextField();
        btnVBRBlockReadPK = new javax.swing.JButton();
        lblValueBlockReadPK = new javax.swing.JLabel();
        lblVBRBlockAddressPK = new javax.swing.JLabel();
        txtValueBlockReadPK = new javax.swing.JTextField();
        lblReadValuePK = new javax.swing.JLabel();
        lblValueAddressPK = new javax.swing.JLabel();
        txtValueAddressPK = new javax.swing.JTextField();
        tabValueBlockWrite = new javax.swing.JPanel();
        pnlValueBlockWrite = new javax.swing.JPanel();
        txtWriteValue = new javax.swing.JTextField();
        txtVBWBlockAddress = new javax.swing.JTextField();
        txtVBWValueAddress = new javax.swing.JTextField();
        btnValueBlockWrite = new javax.swing.JButton();
        lblValueBlockWrite = new javax.swing.JLabel();
        lblVBWBlockAddress = new javax.swing.JLabel();
        lblWriteValue = new javax.swing.JLabel();
        lblVBWValueAddress = new javax.swing.JLabel();
        pnlValueBlockWriteAKM1 = new javax.swing.JPanel();
        txtWriteValueAKM1 = new javax.swing.JTextField();
        txtVBWBlockAddressAKM1 = new javax.swing.JTextField();
        txtVBWValueAddressAKM1 = new javax.swing.JTextField();
        btnValueBlockWriteAKM1 = new javax.swing.JButton();
        lblValueBlockWriteAKM1 = new javax.swing.JLabel();
        lblVBWBlockAddressAKM1 = new javax.swing.JLabel();
        lblWriteValueAKM1 = new javax.swing.JLabel();
        lblVBWValueAddressAKM1 = new javax.swing.JLabel();
        pnlValueBlockWriteAKM2 = new javax.swing.JPanel();
        txtWriteValueAKM2 = new javax.swing.JTextField();
        txtVBWBlockAddressAKM2 = new javax.swing.JTextField();
        txtVBWValueAddressAKM2 = new javax.swing.JTextField();
        btnValueBlockWriteAKM2 = new javax.swing.JButton();
        lblValueBlockWriteAKM2 = new javax.swing.JLabel();
        lblVBWBlockAddressAKM2 = new javax.swing.JLabel();
        lblWriteValueAKM2 = new javax.swing.JLabel();
        lblVBWValueAddressAKM2 = new javax.swing.JLabel();
        pnlValueBlockWritePK = new javax.swing.JPanel();
        txtWriteValuePK = new javax.swing.JTextField();
        txtVBWBlockAddressPK = new javax.swing.JTextField();
        txtVBWValueAddressPK = new javax.swing.JTextField();
        btnValueBlockWritePK = new javax.swing.JButton();
        lblValueBlockWritePK = new javax.swing.JLabel();
        lblVBWBlockAddressPK = new javax.swing.JLabel();
        lblWriteValuePK = new javax.swing.JLabel();
        lblVBWValueAddressPK = new javax.swing.JLabel();
        txtFErrorExplain = new javax.swing.JTextField();
        txtFErrorCode = new javax.swing.JTextField();
        lblFunction = new javax.swing.JTextField();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setTitle("ValueBlock Read/Write");
        setName("frmValueBlockReadWrite"); // NOI18N
        setPreferredSize(new java.awt.Dimension(555, 387));
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameActivated(evt);
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlHeader.setBackground(new java.awt.Color(255, 255, 255));
        pnlHeader.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        rbAUTH1A.setBackground(new java.awt.Color(255, 255, 255));
        btngAUTH1AB.add(rbAUTH1A);
        rbAUTH1A.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        rbAUTH1A.setSelected(true);
        rbAUTH1A.setText("AUTH 1A");
        rbAUTH1A.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        rbAUTH1B.setBackground(new java.awt.Color(255, 255, 255));
        btngAUTH1AB.add(rbAUTH1B);
        rbAUTH1B.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        rbAUTH1B.setText("AUTH 1B");
        rbAUTH1B.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        lblKeyIndex.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblKeyIndex.setText("Key Index");

        cboKeyIndex.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31" }));
        cboKeyIndex.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

        jLabel1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jLabel1.setText("PK");

        javax.swing.GroupLayout pnlHeaderLayout = new javax.swing.GroupLayout(pnlHeader);
        pnlHeader.setLayout(pnlHeaderLayout);
        pnlHeaderLayout.setHorizontalGroup(
            pnlHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeaderLayout.createSequentialGroup()
                .addGap(4, 4, 4)
                .addComponent(rbAUTH1A)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(rbAUTH1B)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lblKeyIndex)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cboKeyIndex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addContainerGap(272, Short.MAX_VALUE))
        );
        pnlHeaderLayout.setVerticalGroup(
            pnlHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlHeaderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(rbAUTH1A)
                .addComponent(rbAUTH1B)
                .addComponent(lblKeyIndex)
                .addComponent(cboKeyIndex, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jLabel1))
        );

        getContentPane().add(pnlHeader, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 553, -1));

        pgValueBlockReadWrite.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N

        tabValueBlockRead.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        pnlValueBlockRead.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBRBlockAddress.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBRBlockAddress.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBRBlockAddress.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnVBRBlockRead.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnVBRBlockRead.setText("READ");
        btnVBRBlockRead.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnVBRBlockRead.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVBRBlockReadActionPerformed(evt);
            }
        });

        lblValueBlockRead.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockRead.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockRead.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockRead.setText("ValueBlock Read");
        lblValueBlockRead.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockRead.setOpaque(true);

        lblVBRBlockAddress.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBRBlockAddress.setText("Block Address");

        txtValueBlockRead.setEditable(false);
        txtValueBlockRead.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtValueBlockRead.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueBlockRead.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblReadValue.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblReadValue.setText("Read Value");

        lblValueAddress.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblValueAddress.setText("Value Address");

        txtValueAddress.setEditable(false);
        txtValueAddress.setBackground(new java.awt.Color(204, 204, 204));
        txtValueAddress.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtValueAddress.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueAddress.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout pnlValueBlockReadLayout = new javax.swing.GroupLayout(pnlValueBlockRead);
        pnlValueBlockRead.setLayout(pnlValueBlockReadLayout);
        pnlValueBlockReadLayout.setHorizontalGroup(
            pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockRead, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
            .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                                .addComponent(lblVBRBlockAddress)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtVBRBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblReadValue))
                        .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(btnVBRBlockRead, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE))
                            .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblValueAddress)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlValueBlockReadLayout.createSequentialGroup()
                        .addComponent(txtValueBlockRead, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                        .addComponent(txtValueAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24))))
        );
        pnlValueBlockReadLayout.setVerticalGroup(
            pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockReadLayout.createSequentialGroup()
                .addComponent(lblValueBlockRead, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVBRBlockRead, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVBRBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblVBRBlockAddress))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblReadValue)
                    .addComponent(lblValueAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtValueAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtValueBlockRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        tabValueBlockRead.add(pnlValueBlockRead, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 0, -1, 125));

        pnlValueBlockReadAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBRBlockAddressAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBRBlockAddressAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBRBlockAddressAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnVBRBlockReadAKM1.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnVBRBlockReadAKM1.setText("READ");
        btnVBRBlockReadAKM1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnVBRBlockReadAKM1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVBRBlockReadAKM1ActionPerformed(evt);
            }
        });

        lblValueBlockReadAKM1.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockReadAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockReadAKM1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockReadAKM1.setText("ValueBlockRead AKM1");
        lblValueBlockReadAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockReadAKM1.setOpaque(true);

        lblVBRBlockAddressAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBRBlockAddressAKM1.setText("Block Address");

        txtValueBlockReadAKM1.setEditable(false);
        txtValueBlockReadAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtValueBlockReadAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueBlockReadAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblReadValueAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblReadValueAKM1.setText("Read Value");

        lblValueAddressAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblValueAddressAKM1.setText("Value Address");

        txtValueAddressAKM1.setEditable(false);
        txtValueAddressAKM1.setBackground(new java.awt.Color(204, 204, 204));
        txtValueAddressAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtValueAddressAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueAddressAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout pnlValueBlockReadAKM1Layout = new javax.swing.GroupLayout(pnlValueBlockReadAKM1);
        pnlValueBlockReadAKM1.setLayout(pnlValueBlockReadAKM1Layout);
        pnlValueBlockReadAKM1Layout.setHorizontalGroup(
            pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockReadAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
            .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                                .addComponent(lblVBRBlockAddressAKM1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtVBRBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblReadValueAKM1))
                        .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(btnVBRBlockReadAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE))
                            .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblValueAddressAKM1)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlValueBlockReadAKM1Layout.createSequentialGroup()
                        .addComponent(txtValueBlockReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                        .addComponent(txtValueAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24))))
        );
        pnlValueBlockReadAKM1Layout.setVerticalGroup(
            pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockReadAKM1Layout.createSequentialGroup()
                .addComponent(lblValueBlockReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVBRBlockReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVBRBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblVBRBlockAddressAKM1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblReadValueAKM1)
                    .addComponent(lblValueAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtValueAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtValueBlockReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        tabValueBlockRead.add(pnlValueBlockReadAKM1, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 0, -1, 125));

        pnlValueBlockReadAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBRBlockAddressAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBRBlockAddressAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBRBlockAddressAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnVBRBlockReadAKM2.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnVBRBlockReadAKM2.setText("READ");
        btnVBRBlockReadAKM2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnVBRBlockReadAKM2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVBRBlockReadAKM2ActionPerformed(evt);
            }
        });

        lblValueBlockReadAKM2.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockReadAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockReadAKM2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockReadAKM2.setText("ValueBlockRead AKM2");
        lblValueBlockReadAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockReadAKM2.setOpaque(true);

        lblVBRBlockAddressAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBRBlockAddressAKM2.setText("Block Address");

        txtValueBlockReadAKM2.setEditable(false);
        txtValueBlockReadAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtValueBlockReadAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueBlockReadAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblReadValueAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblReadValueAKM2.setText("Read Value");

        lblValueAddressAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblValueAddressAKM2.setText("Value Address");

        txtValueAddressAKM2.setEditable(false);
        txtValueAddressAKM2.setBackground(new java.awt.Color(204, 204, 204));
        txtValueAddressAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtValueAddressAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueAddressAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout pnlValueBlockReadAKM2Layout = new javax.swing.GroupLayout(pnlValueBlockReadAKM2);
        pnlValueBlockReadAKM2.setLayout(pnlValueBlockReadAKM2Layout);
        pnlValueBlockReadAKM2Layout.setHorizontalGroup(
            pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockReadAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
            .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                                .addComponent(lblVBRBlockAddressAKM2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtVBRBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblReadValueAKM2))
                        .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(btnVBRBlockReadAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE))
                            .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblValueAddressAKM2)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlValueBlockReadAKM2Layout.createSequentialGroup()
                        .addComponent(txtValueBlockReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                        .addComponent(txtValueAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24))))
        );
        pnlValueBlockReadAKM2Layout.setVerticalGroup(
            pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockReadAKM2Layout.createSequentialGroup()
                .addComponent(lblValueBlockReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVBRBlockReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVBRBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblVBRBlockAddressAKM2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblReadValueAKM2)
                    .addComponent(lblValueAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtValueAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtValueBlockReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        tabValueBlockRead.add(pnlValueBlockReadAKM2, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 130, -1, 125));

        pnlValueBlockReadPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBRBlockAddressPK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBRBlockAddressPK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBRBlockAddressPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnVBRBlockReadPK.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnVBRBlockReadPK.setText("READ");
        btnVBRBlockReadPK.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnVBRBlockReadPK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnVBRBlockReadPKActionPerformed(evt);
            }
        });

        lblValueBlockReadPK.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockReadPK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockReadPK.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockReadPK.setText("ValueBlockRead PK");
        lblValueBlockReadPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockReadPK.setOpaque(true);

        lblVBRBlockAddressPK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBRBlockAddressPK.setText("Block Address");

        txtValueBlockReadPK.setEditable(false);
        txtValueBlockReadPK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtValueBlockReadPK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueBlockReadPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        lblReadValuePK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblReadValuePK.setText("Read Value");

        lblValueAddressPK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblValueAddressPK.setText("Value Address");

        txtValueAddressPK.setEditable(false);
        txtValueAddressPK.setBackground(new java.awt.Color(204, 204, 204));
        txtValueAddressPK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtValueAddressPK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtValueAddressPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        javax.swing.GroupLayout pnlValueBlockReadPKLayout = new javax.swing.GroupLayout(pnlValueBlockReadPK);
        pnlValueBlockReadPK.setLayout(pnlValueBlockReadPKLayout);
        pnlValueBlockReadPKLayout.setHorizontalGroup(
            pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockReadPK, javax.swing.GroupLayout.DEFAULT_SIZE, 233, Short.MAX_VALUE)
            .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                                .addComponent(lblVBRBlockAddressPK)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtVBRBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(lblReadValuePK))
                        .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(btnVBRBlockReadPK, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE))
                            .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(lblValueAddressPK)))
                        .addContainerGap())
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlValueBlockReadPKLayout.createSequentialGroup()
                        .addComponent(txtValueBlockReadPK, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                        .addComponent(txtValueAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(24, 24, 24))))
        );
        pnlValueBlockReadPKLayout.setVerticalGroup(
            pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockReadPKLayout.createSequentialGroup()
                .addComponent(lblValueBlockReadPK, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnVBRBlockReadPK, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtVBRBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblVBRBlockAddressPK))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblReadValuePK)
                    .addComponent(lblValueAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtValueAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtValueBlockReadPK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        tabValueBlockRead.add(pnlValueBlockReadPK, new org.netbeans.lib.awtextra.AbsoluteConstraints(290, 130, -1, 125));

        pgValueBlockReadWrite.addTab("ValueBlock Read", tabValueBlockRead);

        pnlValueBlockWrite.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtWriteValue.setBackground(new java.awt.Color(249, 244, 244));
        txtWriteValue.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtWriteValue.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtWriteValue.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWBlockAddress.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWBlockAddress.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWBlockAddress.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWValueAddress.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWValueAddress.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWValueAddress.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnValueBlockWrite.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnValueBlockWrite.setText("WRITE");
        btnValueBlockWrite.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnValueBlockWrite.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnValueBlockWriteActionPerformed(evt);
            }
        });

        lblValueBlockWrite.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockWrite.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockWrite.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockWrite.setText("ValueBlock Write");
        lblValueBlockWrite.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockWrite.setOpaque(true);

        lblVBWBlockAddress.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWBlockAddress.setText("Block Address");

        lblWriteValue.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblWriteValue.setText("Write Value");

        lblVBWValueAddress.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWValueAddress.setText("Value Address");

        javax.swing.GroupLayout pnlValueBlockWriteLayout = new javax.swing.GroupLayout(pnlValueBlockWrite);
        pnlValueBlockWrite.setLayout(pnlValueBlockWriteLayout);
        pnlValueBlockWriteLayout.setHorizontalGroup(
            pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockWrite, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
            .addGroup(pnlValueBlockWriteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockWriteLayout.createSequentialGroup()
                        .addComponent(lblWriteValue)
                        .addGap(19, 19, 19)
                        .addComponent(txtWriteValue, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
                    .addGroup(pnlValueBlockWriteLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblVBWBlockAddress)
                            .addComponent(lblVBWValueAddress))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtVBWValueAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtVBWBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(7, 7, 7)
                        .addComponent(btnValueBlockWrite, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlValueBlockWriteLayout.setVerticalGroup(
            pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockWriteLayout.createSequentialGroup()
                .addComponent(lblValueBlockWrite, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblWriteValue)
                    .addComponent(txtWriteValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlValueBlockWriteLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWBlockAddress)
                            .addComponent(txtVBWBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWValueAddress)
                            .addComponent(txtVBWValueAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnValueBlockWrite, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        pnlValueBlockWriteAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtWriteValueAKM1.setBackground(new java.awt.Color(249, 244, 244));
        txtWriteValueAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtWriteValueAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtWriteValueAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWBlockAddressAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWBlockAddressAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWBlockAddressAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWValueAddressAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWValueAddressAKM1.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWValueAddressAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnValueBlockWriteAKM1.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnValueBlockWriteAKM1.setText("WRITE");
        btnValueBlockWriteAKM1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnValueBlockWriteAKM1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnValueBlockWriteAKM1ActionPerformed(evt);
            }
        });

        lblValueBlockWriteAKM1.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockWriteAKM1.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockWriteAKM1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockWriteAKM1.setText("ValueBlockWrite AKM1");
        lblValueBlockWriteAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockWriteAKM1.setOpaque(true);

        lblVBWBlockAddressAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWBlockAddressAKM1.setText("Block Address");

        lblWriteValueAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblWriteValueAKM1.setText("Write Value");

        lblVBWValueAddressAKM1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWValueAddressAKM1.setText("Value Address");

        javax.swing.GroupLayout pnlValueBlockWriteAKM1Layout = new javax.swing.GroupLayout(pnlValueBlockWriteAKM1);
        pnlValueBlockWriteAKM1.setLayout(pnlValueBlockWriteAKM1Layout);
        pnlValueBlockWriteAKM1Layout.setHorizontalGroup(
            pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockWriteAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
            .addGroup(pnlValueBlockWriteAKM1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockWriteAKM1Layout.createSequentialGroup()
                        .addComponent(lblWriteValueAKM1)
                        .addGap(19, 19, 19)
                        .addComponent(txtWriteValueAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
                    .addGroup(pnlValueBlockWriteAKM1Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblVBWBlockAddressAKM1)
                            .addComponent(lblVBWValueAddressAKM1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtVBWValueAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtVBWBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(7, 7, 7)
                        .addComponent(btnValueBlockWriteAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlValueBlockWriteAKM1Layout.setVerticalGroup(
            pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockWriteAKM1Layout.createSequentialGroup()
                .addComponent(lblValueBlockWriteAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblWriteValueAKM1)
                    .addComponent(txtWriteValueAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlValueBlockWriteAKM1Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWBlockAddressAKM1)
                            .addComponent(txtVBWBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWValueAddressAKM1)
                            .addComponent(txtVBWValueAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnValueBlockWriteAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        pnlValueBlockWriteAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtWriteValueAKM2.setBackground(new java.awt.Color(249, 244, 244));
        txtWriteValueAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtWriteValueAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtWriteValueAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWBlockAddressAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWBlockAddressAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWBlockAddressAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWValueAddressAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWValueAddressAKM2.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWValueAddressAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnValueBlockWriteAKM2.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnValueBlockWriteAKM2.setText("WRITE");
        btnValueBlockWriteAKM2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnValueBlockWriteAKM2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnValueBlockWriteAKM2ActionPerformed(evt);
            }
        });

        lblValueBlockWriteAKM2.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockWriteAKM2.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockWriteAKM2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockWriteAKM2.setText("ValueBlockWrite AKM2");
        lblValueBlockWriteAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockWriteAKM2.setOpaque(true);

        lblVBWBlockAddressAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWBlockAddressAKM2.setText("Block Address");

        lblWriteValueAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblWriteValueAKM2.setText("Write Value");

        lblVBWValueAddressAKM2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWValueAddressAKM2.setText("Value Address");

        javax.swing.GroupLayout pnlValueBlockWriteAKM2Layout = new javax.swing.GroupLayout(pnlValueBlockWriteAKM2);
        pnlValueBlockWriteAKM2.setLayout(pnlValueBlockWriteAKM2Layout);
        pnlValueBlockWriteAKM2Layout.setHorizontalGroup(
            pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockWriteAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
            .addGroup(pnlValueBlockWriteAKM2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockWriteAKM2Layout.createSequentialGroup()
                        .addComponent(lblWriteValueAKM2)
                        .addGap(19, 19, 19)
                        .addComponent(txtWriteValueAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
                    .addGroup(pnlValueBlockWriteAKM2Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblVBWBlockAddressAKM2)
                            .addComponent(lblVBWValueAddressAKM2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtVBWValueAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtVBWBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(7, 7, 7)
                        .addComponent(btnValueBlockWriteAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlValueBlockWriteAKM2Layout.setVerticalGroup(
            pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockWriteAKM2Layout.createSequentialGroup()
                .addComponent(lblValueBlockWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblWriteValueAKM2)
                    .addComponent(txtWriteValueAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlValueBlockWriteAKM2Layout.createSequentialGroup()
                        .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWBlockAddressAKM2)
                            .addComponent(txtVBWBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWValueAddressAKM2)
                            .addComponent(txtVBWValueAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnValueBlockWriteAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        pnlValueBlockWritePK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtWriteValuePK.setBackground(new java.awt.Color(249, 244, 244));
        txtWriteValuePK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtWriteValuePK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtWriteValuePK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWBlockAddressPK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWBlockAddressPK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWBlockAddressPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        txtVBWValueAddressPK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        txtVBWValueAddressPK.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtVBWValueAddressPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        btnValueBlockWritePK.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        btnValueBlockWritePK.setText("WRITE");
        btnValueBlockWritePK.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        btnValueBlockWritePK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnValueBlockWritePKActionPerformed(evt);
            }
        });

        lblValueBlockWritePK.setBackground(new java.awt.Color(153, 153, 153));
        lblValueBlockWritePK.setFont(new java.awt.Font("Verdana", 1, 12)); // NOI18N
        lblValueBlockWritePK.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lblValueBlockWritePK.setText("ValueBlockWrite PK");
        lblValueBlockWritePK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        lblValueBlockWritePK.setOpaque(true);

        lblVBWBlockAddressPK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWBlockAddressPK.setText("Block Address");

        lblWriteValuePK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblWriteValuePK.setText("Write Value");

        lblVBWValueAddressPK.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblVBWValueAddressPK.setText("Value Address");

        javax.swing.GroupLayout pnlValueBlockWritePKLayout = new javax.swing.GroupLayout(pnlValueBlockWritePK);
        pnlValueBlockWritePK.setLayout(pnlValueBlockWritePKLayout);
        pnlValueBlockWritePKLayout.setHorizontalGroup(
            pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblValueBlockWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, 242, Short.MAX_VALUE)
            .addGroup(pnlValueBlockWritePKLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlValueBlockWritePKLayout.createSequentialGroup()
                        .addComponent(lblWriteValuePK)
                        .addGap(19, 19, 19)
                        .addComponent(txtWriteValuePK, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
                    .addGroup(pnlValueBlockWritePKLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblVBWBlockAddressPK)
                            .addComponent(lblVBWValueAddressPK))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtVBWValueAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtVBWBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(7, 7, 7)
                        .addComponent(btnValueBlockWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE)))
                .addContainerGap())
        );
        pnlValueBlockWritePKLayout.setVerticalGroup(
            pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlValueBlockWritePKLayout.createSequentialGroup()
                .addComponent(lblValueBlockWritePK, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lblWriteValuePK)
                    .addComponent(txtWriteValuePK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlValueBlockWritePKLayout.createSequentialGroup()
                        .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWBlockAddressPK)
                            .addComponent(txtVBWBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlValueBlockWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblVBWValueAddressPK)
                            .addComponent(txtVBWValueAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnValueBlockWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout tabValueBlockWriteLayout = new javax.swing.GroupLayout(tabValueBlockWrite);
        tabValueBlockWrite.setLayout(tabValueBlockWriteLayout);
        tabValueBlockWriteLayout.setHorizontalGroup(
            tabValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabValueBlockWriteLayout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(tabValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(tabValueBlockWriteLayout.createSequentialGroup()
                        .addComponent(pnlValueBlockWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pnlValueBlockWritePK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(tabValueBlockWriteLayout.createSequentialGroup()
                        .addComponent(pnlValueBlockWrite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(pnlValueBlockWriteAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(27, Short.MAX_VALUE))
        );
        tabValueBlockWriteLayout.setVerticalGroup(
            tabValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabValueBlockWriteLayout.createSequentialGroup()
                .addGroup(tabValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlValueBlockWrite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlValueBlockWriteAKM1, 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)
                .addGroup(tabValueBlockWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlValueBlockWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pnlValueBlockWritePK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pgValueBlockReadWrite.addTab("ValueBlock Write", tabValueBlockWrite);

        getContentPane().add(pgValueBlockReadWrite, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 31, -1, 299));

        txtFErrorExplain.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtFErrorExplain.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtFErrorExplain.setText(" ");
        getContentPane().add(txtFErrorExplain, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 340, 340, 20));

        txtFErrorCode.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        txtFErrorCode.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        txtFErrorCode.setText(" ");
        getContentPane().add(txtFErrorCode, new org.netbeans.lib.awtextra.AbsoluteConstraints(140, 340, 80, 20));

        lblFunction.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        lblFunction.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        lblFunction.setText("Function Error");
        getContentPane().add(lblFunction, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 340, 140, 20));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void formInternalFrameActivated(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameActivated
        new Global().CreateKey(312, 5, 31, 29, "txtPKKey", pnlHeader);
    }//GEN-LAST:event_formInternalFrameActivated

    private void btnVBRBlockReadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVBRBlockReadActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);                                                  
          byte key_index                  = (byte) cboKeyIndex.getSelectedIndex() ;
          ShortByReference value_address  = new ShortByReference();
          IntByReference read_value       = new IntByReference();
          short block_address             = 0;
        
            if (txtVBRBlockAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBRBlockAddress.requestFocus();
                return;
            }
            
            block_address = Byte.parseByte(txtVBRBlockAddress.getText());

            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockRead(read_value, value_address, block_address, auth_mode, key_index);
            if (iFResult == DL_OK) {
                txtValueBlockRead.setText(Integer.toString(read_value.getValue()));
                txtValueAddress.setText(Short.toString(value_address.getValue()));
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {
                txtValueBlockRead.setText("");
                txtValueAddress.setText("");
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult); 
                
            }
        } catch (NumberFormatException nfe) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
            
        }

    }//GEN-LAST:event_btnVBRBlockReadActionPerformed

    private void btnVBRBlockReadAKM1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVBRBlockReadAKM1ActionPerformed
       frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          ShortByReference value_address  = new ShortByReference();
          IntByReference read_value       = new IntByReference();
          short block_address             = 0;
        
            if (txtVBRBlockAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBRBlockAddressAKM1.requestFocus();
                return;
            }
            
            block_address = Byte.parseByte(txtVBRBlockAddressAKM1.getText());

            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockRead_AKM1(read_value, value_address, block_address, auth_mode);
            if (iFResult == DL_OK) {
                txtValueBlockReadAKM1.setText(Integer.toString(read_value.getValue()));
                txtValueAddressAKM1.setText(Short.toString(value_address.getValue()));
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);
                
            } else {
                txtValueBlockReadAKM1.setText("");
                txtValueAddressAKM1.setText("");
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);
            }
        } catch (NumberFormatException nfe) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
            
        }
    }//GEN-LAST:event_btnVBRBlockReadAKM1ActionPerformed

    private void btnVBRBlockReadAKM2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVBRBlockReadAKM2ActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          ShortByReference value_address  = new ShortByReference();
          IntByReference read_value       = new IntByReference();
          short block_address             = 0;
        
            if (txtVBRBlockAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBRBlockAddressAKM2.requestFocus();
                return;
            }
            
            block_address = Byte.parseByte(txtVBRBlockAddressAKM2.getText());

            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockRead_AKM2(read_value, value_address, block_address, auth_mode);
            if (iFResult == DL_OK) {
                txtValueBlockReadAKM2.setText(Integer.toString(read_value.getValue()));
                txtValueAddressAKM2.setText(Short.toString(value_address.getValue()));
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {
                txtValueBlockReadAKM2.setText("");
                txtValueAddressAKM2.setText("");
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnVBRBlockReadAKM2ActionPerformed

    private void btnVBRBlockReadPKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnVBRBlockReadPKActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          ShortByReference value_address  = new ShortByReference();
          IntByReference read_value       = new IntByReference();
          short block_address             = 0;
        
            if (txtVBRBlockAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBRBlockAddressPK.requestFocus();
                return;
            }
            
            block_address = Byte.parseByte(txtVBRBlockAddressPK.getText());

            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockRead_PK(read_value, value_address, block_address, auth_mode, new Global().PK_KEY(pnlHeader));
            if (iFResult == DL_OK) {
                txtValueBlockReadPK.setText(Integer.toString(read_value.getValue()));
                txtValueAddressPK.setText(Short.toString(value_address.getValue()));
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {
                txtValueBlockReadPK.setText("");
                txtValueAddressPK.setText("");
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnVBRBlockReadPKActionPerformed

    private void btnValueBlockWriteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnValueBlockWriteActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          byte key_index                  = (byte) cboKeyIndex.getSelectedIndex();
          short value_address             = 0;
          int write_value                 = 0;
          short block_address             = 0;
        
            if (txtWriteValue.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtWriteValue.requestFocus();
                return;
            }
            if (txtVBWBlockAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWBlockAddress.requestFocus();
                return;
            }
            if (txtVBWValueAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  VALUE ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWValueAddress.requestFocus();
                return;
            }
           
            block_address = Byte.parseByte(txtVBWBlockAddress.getText());
            value_address = Short.parseShort(txtVBWValueAddress.getText());
            write_value   = Integer.parseInt(txtWriteValue.getText());
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockWrite(write_value, value_address, block_address, auth_mode, key_index);
            if (iFResult == DL_OK) {
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {               
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnValueBlockWriteActionPerformed

    private void btnValueBlockWriteAKM1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnValueBlockWriteAKM1ActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          short value_address             = 0;
          int write_value                 = 0;
          short block_address             = 0;
        
            if (txtWriteValueAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtWriteValueAKM1.requestFocus();
                return;
            }
            if (txtVBWBlockAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWBlockAddressAKM1.requestFocus();
                return;
            }
            if (txtVBWValueAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  VALUE ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWValueAddressAKM1.requestFocus();
                return;
            }

            
            block_address = Byte.parseByte(txtVBWBlockAddressAKM1.getText());
            value_address = Short.parseShort(txtVBWValueAddressAKM1.getText());
            write_value   = Integer.parseInt(txtWriteValueAKM1.getText());
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockWrite_AKM1(write_value, value_address, block_address, auth_mode);
            
            if (iFResult == DL_OK) {
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {               
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnValueBlockWriteAKM1ActionPerformed

    private void btnValueBlockWriteAKM2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnValueBlockWriteAKM2ActionPerformed
       frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          short value_address             = 0;
          int write_value                 = 0;
          short block_address             = 0;
          
            if (txtWriteValueAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtWriteValueAKM2.requestFocus();
                return;
            }
            if (txtVBWBlockAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWBlockAddressAKM2.requestFocus();
                return;
            }
            if (txtVBWValueAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  VALUE ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWValueAddressAKM2.requestFocus();
                return;
            }

            block_address = Byte.parseByte(txtVBWBlockAddressAKM2.getText());
            value_address = Short.parseShort(txtVBWValueAddressAKM2.getText());
            write_value   = Integer.parseInt(txtWriteValueAKM2.getText());
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockWrite_AKM2(write_value, value_address, block_address, auth_mode);
            if (iFResult == DL_OK) {
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {               
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnValueBlockWriteAKM2ActionPerformed

    private void btnValueBlockWritePKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnValueBlockWritePKActionPerformed
        frmMain M = new frmMain();
        if (M.GetFunct() || M.GetLoop()) {
            return;
        }
        try
        {
          M.SetFunct(true);
          int iFResult                    = 0;
          byte auth_mode                  = (rbAUTH1A.isSelected() ? MIFARE_AUTHENT1A : MIFARE_AUTHENT1B);
          short value_address             = 0;
          int write_value                 = 0;
          short block_address             = 0;
          
            if (txtWriteValuePK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtWriteValuePK.requestFocus();
                return;
            }
            if (txtVBWBlockAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWBlockAddressPK.requestFocus();
                return;
            }
            if (txtVBWValueAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  VALUE ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtVBWValueAddressPK.requestFocus();
                return;
            }

            block_address = Byte.parseByte(txtVBWBlockAddressPK.getText());
            value_address = Short.parseShort(txtVBWValueAddressPK.getText());
            write_value   = Integer.parseInt(txtWriteValuePK.getText());
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.ValueBlockWrite_PK(write_value, value_address, block_address, auth_mode, new Global().PK_KEY(pnlHeader));
            if (iFResult == DL_OK) {
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_OK, FUNCT_SOUND_OK);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            } else {               
                Declarations.UFrDeclarations.UFRInstance.ReaderUISignal(FUNCT_LIGHT_ERROR,FUNCT_SOUND_ERROR);
                M.SetStatusBar(txtFErrorCode,txtFErrorExplain,iFResult);                
            }
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);            
        }
    }//GEN-LAST:event_btnValueBlockWritePKActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnVBRBlockRead;
    private javax.swing.JButton btnVBRBlockReadAKM1;
    private javax.swing.JButton btnVBRBlockReadAKM2;
    private javax.swing.JButton btnVBRBlockReadPK;
    private javax.swing.JButton btnValueBlockWrite;
    private javax.swing.JButton btnValueBlockWriteAKM1;
    private javax.swing.JButton btnValueBlockWriteAKM2;
    private javax.swing.JButton btnValueBlockWritePK;
    private javax.swing.ButtonGroup btngAUTH1AB;
    private javax.swing.JComboBox cboKeyIndex;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JTextField lblFunction;
    private javax.swing.JLabel lblKeyIndex;
    private javax.swing.JLabel lblReadValue;
    private javax.swing.JLabel lblReadValueAKM1;
    private javax.swing.JLabel lblReadValueAKM2;
    private javax.swing.JLabel lblReadValuePK;
    private javax.swing.JLabel lblVBRBlockAddress;
    private javax.swing.JLabel lblVBRBlockAddressAKM1;
    private javax.swing.JLabel lblVBRBlockAddressAKM2;
    private javax.swing.JLabel lblVBRBlockAddressPK;
    private javax.swing.JLabel lblVBWBlockAddress;
    private javax.swing.JLabel lblVBWBlockAddressAKM1;
    private javax.swing.JLabel lblVBWBlockAddressAKM2;
    private javax.swing.JLabel lblVBWBlockAddressPK;
    private javax.swing.JLabel lblVBWValueAddress;
    private javax.swing.JLabel lblVBWValueAddressAKM1;
    private javax.swing.JLabel lblVBWValueAddressAKM2;
    private javax.swing.JLabel lblVBWValueAddressPK;
    private javax.swing.JLabel lblValueAddress;
    private javax.swing.JLabel lblValueAddressAKM1;
    private javax.swing.JLabel lblValueAddressAKM2;
    private javax.swing.JLabel lblValueAddressPK;
    private javax.swing.JLabel lblValueBlockRead;
    private javax.swing.JLabel lblValueBlockReadAKM1;
    private javax.swing.JLabel lblValueBlockReadAKM2;
    private javax.swing.JLabel lblValueBlockReadPK;
    private javax.swing.JLabel lblValueBlockWrite;
    private javax.swing.JLabel lblValueBlockWriteAKM1;
    private javax.swing.JLabel lblValueBlockWriteAKM2;
    private javax.swing.JLabel lblValueBlockWritePK;
    private javax.swing.JLabel lblWriteValue;
    private javax.swing.JLabel lblWriteValueAKM1;
    private javax.swing.JLabel lblWriteValueAKM2;
    private javax.swing.JLabel lblWriteValuePK;
    private javax.swing.JTabbedPane pgValueBlockReadWrite;
    private javax.swing.JPanel pnlHeader;
    private javax.swing.JPanel pnlValueBlockRead;
    private javax.swing.JPanel pnlValueBlockReadAKM1;
    private javax.swing.JPanel pnlValueBlockReadAKM2;
    private javax.swing.JPanel pnlValueBlockReadPK;
    private javax.swing.JPanel pnlValueBlockWrite;
    private javax.swing.JPanel pnlValueBlockWriteAKM1;
    private javax.swing.JPanel pnlValueBlockWriteAKM2;
    private javax.swing.JPanel pnlValueBlockWritePK;
    private javax.swing.JRadioButton rbAUTH1A;
    private javax.swing.JRadioButton rbAUTH1B;
    private javax.swing.JPanel tabValueBlockRead;
    private javax.swing.JPanel tabValueBlockWrite;
    private javax.swing.JTextField txtFErrorCode;
    private javax.swing.JTextField txtFErrorExplain;
    private javax.swing.JTextField txtVBRBlockAddress;
    private javax.swing.JTextField txtVBRBlockAddressAKM1;
    private javax.swing.JTextField txtVBRBlockAddressAKM2;
    private javax.swing.JTextField txtVBRBlockAddressPK;
    private javax.swing.JTextField txtVBWBlockAddress;
    private javax.swing.JTextField txtVBWBlockAddressAKM1;
    private javax.swing.JTextField txtVBWBlockAddressAKM2;
    private javax.swing.JTextField txtVBWBlockAddressPK;
    private javax.swing.JTextField txtVBWValueAddress;
    private javax.swing.JTextField txtVBWValueAddressAKM1;
    private javax.swing.JTextField txtVBWValueAddressAKM2;
    private javax.swing.JTextField txtVBWValueAddressPK;
    private javax.swing.JTextField txtValueAddress;
    private javax.swing.JTextField txtValueAddressAKM1;
    private javax.swing.JTextField txtValueAddressAKM2;
    private javax.swing.JTextField txtValueAddressPK;
    private javax.swing.JTextField txtValueBlockRead;
    private javax.swing.JTextField txtValueBlockReadAKM1;
    private javax.swing.JTextField txtValueBlockReadAKM2;
    private javax.swing.JTextField txtValueBlockReadPK;
    private javax.swing.JTextField txtWriteValue;
    private javax.swing.JTextField txtWriteValueAKM1;
    private javax.swing.JTextField txtWriteValueAKM2;
    private javax.swing.JTextField txtWriteValuePK;
    // End of variables declaration//GEN-END:variables
}
