package ufradvanced;

import javax.swing.JOptionPane;

public class frmBlockInSectorReadWrite extends javax.swing.JInternalFrame {

    public frmBlockInSectorReadWrite() {
        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,
         MAX_BLOCK_BYTES    = 16;
    
    
    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();
        pgBlockInSectorReadWrite = new javax.swing.JTabbedPane();
        tabBlockInSectorRead = new javax.swing.JPanel();
        pnlBlockInSectorRead = new javax.swing.JPanel();
        txtBRSectorAddress = new javax.swing.JTextField();
        txtBRBlockAddress = new javax.swing.JTextField();
        btnBlockInSectorRead = new javax.swing.JButton();
        chkBlockRead = new javax.swing.JCheckBox();
        lblBlockInSectorRead = new javax.swing.JLabel();
        lblBRSectorAddress = new javax.swing.JLabel();
        txtBlockInSectorRead = new javax.swing.JTextField();
        lblReadData = new javax.swing.JLabel();
        lblBRBlockAddress = new javax.swing.JLabel();
        pnlBlockInSectorReadAKM2 = new javax.swing.JPanel();
        txtBRSectorAddressAKM2 = new javax.swing.JTextField();
        btnBlockInSectorReadAKM2 = new javax.swing.JButton();
        chkBlockRead1 = new javax.swing.JCheckBox();
        lblBlockInSectorReadAKM2 = new javax.swing.JLabel();
        lblBRSectorAddressAKM2 = new javax.swing.JLabel();
        txtBlockInSectorReadAKM2 = new javax.swing.JTextField();
        lblReadDataAKM2 = new javax.swing.JLabel();
        lblBRBlockAddressAKM2 = new javax.swing.JLabel();
        txtBRBlockAddressAKM2 = new javax.swing.JTextField();
        pnlBlockInSectorReadPK = new javax.swing.JPanel();
        txtBRSectorAddressPK = new javax.swing.JTextField();
        btnSectorAddressPK = new javax.swing.JButton();
        chkBlockRead3 = new javax.swing.JCheckBox();
        lblBlockInSectorReadPK = new javax.swing.JLabel();
        lblBRSectorAddressPK = new javax.swing.JLabel();
        txtBlockInSectorReadPK = new javax.swing.JTextField();
        lblReadDataPK = new javax.swing.JLabel();
        lblBRBlockAddressPK = new javax.swing.JLabel();
        txtBRBlockAddressPK = new javax.swing.JTextField();
        pnlBlockInSectorReadAKM1 = new javax.swing.JPanel();
        txtBRSectorAddressAKM1 = new javax.swing.JTextField();
        btnBlockInSectorReadAKM1 = new javax.swing.JButton();
        chkBlockRead2 = new javax.swing.JCheckBox();
        lblBlockInSectorReadAKM1 = new javax.swing.JLabel();
        lblBRSectorAddressAKM1 = new javax.swing.JLabel();
        txtBlockInSectorReadAKM1 = new javax.swing.JTextField();
        lblReadDataAKM1 = new javax.swing.JLabel();
        lblBRBlockAddressAKM1 = new javax.swing.JLabel();
        txtBRBlockAddressAKM1 = new javax.swing.JTextField();
        tabBlockInSectorWrite = new javax.swing.JPanel();
        pnlBlockInSectorWrite = new javax.swing.JPanel();
        txtBWSectorAddress = new javax.swing.JTextField();
        txtBWBlockAddress = new javax.swing.JTextField();
        btnBlockInSectorWrite = new javax.swing.JButton();
        chkBlockRead4 = new javax.swing.JCheckBox();
        lblBlockInSectorWrite = new javax.swing.JLabel();
        lblBWSectorAddress = new javax.swing.JLabel();
        lblBWBlockAddress = new javax.swing.JLabel();
        lblWriteData = new javax.swing.JLabel();
        txtBlockInSectorWrite = new javax.swing.JTextField();
        pnlBlockInSectorWriteAKM1 = new javax.swing.JPanel();
        txtBWSectorAddressAKM1 = new javax.swing.JTextField();
        txtBWBlockAddressAKM1 = new javax.swing.JTextField();
        btnBlockInSectorWriteAKM1 = new javax.swing.JButton();
        chkBlockRead5 = new javax.swing.JCheckBox();
        lblBlockInSectorWriteAKM1 = new javax.swing.JLabel();
        lblBWSectorAddressAKM1 = new javax.swing.JLabel();
        lblBWBlockAddressAKM1 = new javax.swing.JLabel();
        lblWriteDataAKM1 = new javax.swing.JLabel();
        txtBlockInSectorWriteAKM1 = new javax.swing.JTextField();
        pnlBlockInSectorWriteAKM2 = new javax.swing.JPanel();
        txtBWSectorAddressAKM2 = new javax.swing.JTextField();
        txtBWBlockAddressAKM2 = new javax.swing.JTextField();
        btnBlockInSectorWriteAKM2 = new javax.swing.JButton();
        chkBlockRead6 = new javax.swing.JCheckBox();
        lblBlockInSectorWriteAKM2 = new javax.swing.JLabel();
        lblBWSectorAddressAKM2 = new javax.swing.JLabel();
        lblBWBlockAddressAKM2 = new javax.swing.JLabel();
        lblWriteDataAKM2 = new javax.swing.JLabel();
        txtBlockInSectorWriteAKM2 = new javax.swing.JTextField();
        pnlBlockInSectorWritePK = new javax.swing.JPanel();
        txtBWSectorAddressPK = new javax.swing.JTextField();
        txtBWBlockAddressPK = new javax.swing.JTextField();
        btnBlockInSectorWritePK = new javax.swing.JButton();
        chkBlockRead7 = new javax.swing.JCheckBox();
        lblBlockInSectorWritePK = new javax.swing.JLabel();
        lblBWSectorAddressPK = new javax.swing.JLabel();
        lblBWBlockAddressPK = new javax.swing.JLabel();
        lblWriteDataPK = new javax.swing.JLabel();
        txtBlockInSectorWritePK = new javax.swing.JTextField();
        lblFunction = new javax.swing.JTextField();
        txtFErrorCode = new javax.swing.JTextField();
        txtFErrorExplain = new javax.swing.JTextField();

        setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        setTitle("BlockInSectorReadWrite");
        setName("frmBlockInSectorReadWrite"); // NOI18N
        setPreferredSize(new java.awt.Dimension(555, 387));
        setRequestFocusEnabled(false);
        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(319, 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, 600, -1));

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

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

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

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

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

        chkBlockRead.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead.setText("Ascii");
        chkBlockRead.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorReadLayout = new javax.swing.GroupLayout(pnlBlockInSectorRead);
        pnlBlockInSectorRead.setLayout(pnlBlockInSectorReadLayout);
        pnlBlockInSectorReadLayout.setHorizontalGroup(
            pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorRead, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlBlockInSectorReadLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                                .addComponent(lblBRSectorAddress)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBRSectorAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                                .addComponent(lblBRBlockAddress)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBRBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                        .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkBlockRead, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnBlockInSectorRead, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                        .addComponent(lblReadData)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtBlockInSectorRead))
                .addContainerGap())
        );
        pnlBlockInSectorReadLayout.setVerticalGroup(
            pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                .addComponent(lblBlockInSectorRead, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlBlockInSectorReadLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBRSectorAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBRSectorAddress))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lblBRBlockAddress)
                            .addComponent(txtBRBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorRead, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chkBlockRead, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(lblReadData)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtBlockInSectorRead, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pnlBlockInSectorReadAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorReadAKM2.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

        chkBlockRead1.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead1.setText("Ascii");
        chkBlockRead1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorReadAKM2Layout = new javax.swing.GroupLayout(pnlBlockInSectorReadAKM2);
        pnlBlockInSectorReadAKM2.setLayout(pnlBlockInSectorReadAKM2Layout);
        pnlBlockInSectorReadAKM2Layout.setHorizontalGroup(
            pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                                .addGap(0, 8, Short.MAX_VALUE)
                                .addComponent(lblReadDataAKM2)
                                .addGap(73, 73, 73))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                                .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(lblBRSectorAddressAKM2)
                                    .addComponent(lblBRBlockAddressAKM2))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtBRBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(txtBRSectorAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnBlockInSectorReadAKM2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(chkBlockRead1)))
                    .addComponent(txtBlockInSectorReadAKM2))
                .addGap(8, 8, 8))
            .addComponent(lblBlockInSectorReadAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        pnlBlockInSectorReadAKM2Layout.setVerticalGroup(
            pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                .addComponent(lblBlockInSectorReadAKM2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorReadAKM2Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBRSectorAddressAKM2)
                            .addComponent(txtBRSectorAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBRBlockAddressAKM2)
                            .addComponent(txtBRBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorReadAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorReadAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(chkBlockRead1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(lblReadDataAKM2))
                .addGap(10, 10, 10)
                .addComponent(txtBlockInSectorReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pnlBlockInSectorReadPK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorReadPK.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

        chkBlockRead3.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead3.setText("Ascii");
        chkBlockRead3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorReadPKLayout = new javax.swing.GroupLayout(pnlBlockInSectorReadPK);
        pnlBlockInSectorReadPK.setLayout(pnlBlockInSectorReadPKLayout);
        pnlBlockInSectorReadPKLayout.setHorizontalGroup(
            pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorReadPK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorReadPKLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblReadDataPK)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlBlockInSectorReadPKLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorReadPKLayout.createSequentialGroup()
                                .addComponent(lblBRSectorAddressPK)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBRSectorAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorReadPKLayout.createSequentialGroup()
                                .addComponent(lblBRBlockAddressPK)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBRBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(8, 8, 8)
                        .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkBlockRead3)
                            .addComponent(btnSectorAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txtBlockInSectorReadPK))
                .addContainerGap())
        );
        pnlBlockInSectorReadPKLayout.setVerticalGroup(
            pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorReadPKLayout.createSequentialGroup()
                .addComponent(lblBlockInSectorReadPK)
                .addGap(12, 12, 12)
                .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlBlockInSectorReadPKLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBRSectorAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBRSectorAddressPK))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorReadPKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBRBlockAddressPK)
                            .addComponent(txtBRBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnSectorAddressPK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chkBlockRead3, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(lblReadDataPK)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtBlockInSectorReadPK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pnlBlockInSectorReadAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorReadAKM1.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

        chkBlockRead2.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead2.setText("Ascii");
        chkBlockRead2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorReadAKM1Layout = new javax.swing.GroupLayout(pnlBlockInSectorReadAKM1);
        pnlBlockInSectorReadAKM1.setLayout(pnlBlockInSectorReadAKM1Layout);
        pnlBlockInSectorReadAKM1Layout.setHorizontalGroup(
            pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorReadAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lblReadDataAKM1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                                .addComponent(lblBRSectorAddressAKM1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBRSectorAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                                .addComponent(lblBRBlockAddressAKM1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBRBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(8, 8, 8)
                        .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkBlockRead2)
                            .addComponent(btnBlockInSectorReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(txtBlockInSectorReadAKM1))
                .addContainerGap())
        );
        pnlBlockInSectorReadAKM1Layout.setVerticalGroup(
            pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                .addComponent(lblBlockInSectorReadAKM1)
                .addGap(12, 12, 12)
                .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(pnlBlockInSectorReadAKM1Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBRSectorAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBRSectorAddressAKM1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorReadAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBRBlockAddressAKM1)
                            .addComponent(txtBRBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorReadAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(chkBlockRead2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(lblReadDataAKM1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(txtBlockInSectorReadAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout tabBlockInSectorReadLayout = new javax.swing.GroupLayout(tabBlockInSectorRead);
        tabBlockInSectorRead.setLayout(tabBlockInSectorReadLayout);
        tabBlockInSectorReadLayout.setHorizontalGroup(
            tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabBlockInSectorReadLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pnlBlockInSectorRead, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlBlockInSectorReadAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, 249, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(pnlBlockInSectorReadPK, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
                    .addComponent(pnlBlockInSectorReadAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        tabBlockInSectorReadLayout.setVerticalGroup(
            tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabBlockInSectorReadLayout.createSequentialGroup()
                .addGroup(tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(pnlBlockInSectorReadAKM1, 0, 0, Short.MAX_VALUE)
                    .addComponent(pnlBlockInSectorRead, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(tabBlockInSectorReadLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(pnlBlockInSectorReadPK, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(pnlBlockInSectorReadAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pgBlockInSectorReadWrite.addTab("BlockInSector Read", tabBlockInSectorRead);

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

        pnlBlockInSectorWrite.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorWrite.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

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

        chkBlockRead4.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead4.setText("Ascii");
        chkBlockRead4.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorWriteLayout = new javax.swing.GroupLayout(pnlBlockInSectorWrite);
        pnlBlockInSectorWrite.setLayout(pnlBlockInSectorWriteLayout);
        pnlBlockInSectorWriteLayout.setHorizontalGroup(
            pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorWrite, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                        .addComponent(lblWriteData)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtBlockInSectorWrite)
                    .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                                .addComponent(lblBWBlockAddress)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBWBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                                .addComponent(lblBWSectorAddress)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBWSectorAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(14, 14, 14)
                        .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(chkBlockRead4))
                            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                                .addComponent(btnBlockInSectorWrite, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 1, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        pnlBlockInSectorWriteLayout.setVerticalGroup(
            pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                .addComponent(lblBlockInSectorWrite, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblWriteData)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkBlockRead4, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBlockInSectorWrite, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBWSectorAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBWSectorAddress))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorWriteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBWBlockAddress)
                            .addComponent(txtBWBlockAddress, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorWrite, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(11, 11, 11))
        );

        tabBlockInSectorWrite.add(pnlBlockInSectorWrite, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 0, 242, -1));

        pnlBlockInSectorWriteAKM1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorWriteAKM1.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

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

        chkBlockRead5.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead5.setText("Ascii");
        chkBlockRead5.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorWriteAKM1Layout = new javax.swing.GroupLayout(pnlBlockInSectorWriteAKM1);
        pnlBlockInSectorWriteAKM1.setLayout(pnlBlockInSectorWriteAKM1Layout);
        pnlBlockInSectorWriteAKM1Layout.setHorizontalGroup(
            pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorWriteAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                        .addComponent(lblWriteDataAKM1)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtBlockInSectorWriteAKM1)
                    .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                                .addComponent(lblBWBlockAddressAKM1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBWBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                                .addComponent(lblBWSectorAddressAKM1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBWSectorAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(14, 14, 14)
                        .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(chkBlockRead5))
                            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                                .addComponent(btnBlockInSectorWriteAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 2, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        pnlBlockInSectorWriteAKM1Layout.setVerticalGroup(
            pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                .addComponent(lblBlockInSectorWriteAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblWriteDataAKM1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkBlockRead5, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBlockInSectorWriteAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteAKM1Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBWSectorAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBWSectorAddressAKM1))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorWriteAKM1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBWBlockAddressAKM1)
                            .addComponent(txtBWBlockAddressAKM1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorWriteAKM1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(11, 11, 11))
        );

        tabBlockInSectorWrite.add(pnlBlockInSectorWriteAKM1, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 0, -1, -1));

        pnlBlockInSectorWriteAKM2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorWriteAKM2.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

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

        chkBlockRead6.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead6.setText("Ascii");
        chkBlockRead6.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorWriteAKM2Layout = new javax.swing.GroupLayout(pnlBlockInSectorWriteAKM2);
        pnlBlockInSectorWriteAKM2.setLayout(pnlBlockInSectorWriteAKM2Layout);
        pnlBlockInSectorWriteAKM2Layout.setHorizontalGroup(
            pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                        .addComponent(lblWriteDataAKM2)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtBlockInSectorWriteAKM2)
                    .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                                .addComponent(lblBWBlockAddressAKM2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBWBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                                .addComponent(lblBWSectorAddressAKM2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBWSectorAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(14, 14, 14)
                        .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(chkBlockRead6))
                            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                                .addComponent(btnBlockInSectorWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 1, Short.MAX_VALUE)))))
                .addContainerGap())
            .addComponent(lblBlockInSectorWriteAKM2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        pnlBlockInSectorWriteAKM2Layout.setVerticalGroup(
            pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                .addComponent(lblBlockInSectorWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblWriteDataAKM2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkBlockRead6, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBlockInSectorWriteAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWriteAKM2Layout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBWSectorAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBWSectorAddressAKM2))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorWriteAKM2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBWBlockAddressAKM2)
                            .addComponent(txtBWBlockAddressAKM2, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorWriteAKM2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        tabBlockInSectorWrite.add(pnlBlockInSectorWriteAKM2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 140, 242, -1));

        pnlBlockInSectorWritePK.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        pnlBlockInSectorWritePK.setPreferredSize(new java.awt.Dimension(241, 135));

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

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

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

        chkBlockRead7.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        chkBlockRead7.setText("Ascii");
        chkBlockRead7.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));

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

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

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

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

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

        javax.swing.GroupLayout pnlBlockInSectorWritePKLayout = new javax.swing.GroupLayout(pnlBlockInSectorWritePK);
        pnlBlockInSectorWritePK.setLayout(pnlBlockInSectorWritePKLayout);
        pnlBlockInSectorWritePKLayout.setHorizontalGroup(
            pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(lblBlockInSectorWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                        .addComponent(lblWriteDataPK)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(txtBlockInSectorWritePK)
                    .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                                .addComponent(lblBWBlockAddressPK)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(txtBWBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                                .addComponent(lblBWSectorAddressPK)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(txtBWSectorAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(14, 14, 14)
                        .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(chkBlockRead7, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(btnBlockInSectorWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE))))
                .addContainerGap())
        );
        pnlBlockInSectorWritePKLayout.setVerticalGroup(
            pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                .addComponent(lblBlockInSectorWritePK, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(lblWriteDataPK)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(chkBlockRead7, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtBlockInSectorWritePK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(pnlBlockInSectorWritePKLayout.createSequentialGroup()
                        .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtBWSectorAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lblBWSectorAddressPK))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(pnlBlockInSectorWritePKLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lblBWBlockAddressPK)
                            .addComponent(txtBWBlockAddressPK, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addComponent(btnBlockInSectorWritePK, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        tabBlockInSectorWrite.add(pnlBlockInSectorWritePK, new org.netbeans.lib.awtextra.AbsoluteConstraints(280, 140, -1, -1));

        pgBlockInSectorReadWrite.addTab("BlockInSector Write", tabBlockInSectorWrite);

        getContentPane().add(pgBlockInSectorReadWrite, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 26, -1, 309));

        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));

        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));

        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, 320, 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 btnBlockInSectorReadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorReadActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] read_data    = new byte[MAX_BLOCK_BYTES];
          byte key_index      = (byte) cboKeyIndex.getSelectedIndex() ;
          
            if (txtBRSectorAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the SECTOR ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRSectorAddress.requestFocus();
                return;
            }
            if (txtBRBlockAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRBlockAddress.requestFocus();
                return;
            }
                        
            txtBlockInSectorRead.setText("");
            sector_address = Byte.parseByte(txtBRSectorAddress.getText());
            block_address  = Byte.parseByte(txtBRBlockAddress.getText());
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorRead(read_data, sector_address, block_address, auth_mode, key_index);
            if (iFResult == DL_OK) {                
                txtBlockInSectorRead.setText(new String(read_data));
                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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorReadActionPerformed

    private void btnBlockInSectorReadAKM2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorReadAKM2ActionPerformed
       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 sector_address = 0;
          byte block_address  = 0;
          byte[] read_data    = new byte[MAX_BLOCK_BYTES];
          
            if (txtBRSectorAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRSectorAddressAKM2.requestFocus();
                return;
            }
            if (txtBRBlockAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRBlockAddressAKM2.requestFocus();
                return;
            }
            
            sector_address = Byte.parseByte(txtBRSectorAddressAKM2.getText());
            block_address = Byte.parseByte(txtBRBlockAddressAKM2.getText());
            txtBlockInSectorReadAKM2.setText("");
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorRead_AKM2(read_data, sector_address, block_address, auth_mode);
            if (iFResult == DL_OK) {                
                txtBlockInSectorReadAKM2.setText(new String(read_data));
                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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorReadAKM2ActionPerformed

    private void btnSectorAddressPKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSectorAddressPKActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] read_data    = new byte[MAX_BLOCK_BYTES];
          
            if (txtBRSectorAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRSectorAddressPK.requestFocus();
                return;
            }
            if (txtBRBlockAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRBlockAddressPK.requestFocus();
                return;
            }

            sector_address = Byte.parseByte(txtBRSectorAddressPK.getText());
            block_address = Byte.parseByte(txtBRBlockAddressPK.getText());
            txtBlockInSectorReadPK.setText("");
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorRead_PK(read_data, sector_address, block_address, auth_mode, new Global().PK_KEY(pnlHeader));
            if (iFResult == DL_OK) {                
                txtBlockInSectorReadPK.setText(new String(read_data));
                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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }

    }//GEN-LAST:event_btnSectorAddressPKActionPerformed

    private void btnBlockInSectorReadAKM1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorReadAKM1ActionPerformed
         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 sector_address = 0;
          byte block_address  = 0;
          byte[] read_data    = new byte[MAX_BLOCK_BYTES];
          
            if (txtBRSectorAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRSectorAddressAKM1.requestFocus();
                return;
            }
            if (txtBRBlockAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBRBlockAddressAKM1.requestFocus();
                return;
            }

            sector_address = Byte.parseByte(txtBRSectorAddressAKM1.getText());
            block_address = Byte.parseByte(txtBRBlockAddressAKM1.getText());
            txtBlockInSectorReadAKM1.setText("");
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorRead_AKM1(read_data, sector_address, block_address, auth_mode);
           if (iFResult == DL_OK) {                
                txtBlockInSectorReadAKM1.setText(new String(read_data));
                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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorReadAKM1ActionPerformed

    private void btnBlockInSectorWriteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorWriteActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] write_data    = new byte[MAX_BLOCK_BYTES];
          byte key_index      = (byte) cboKeyIndex.getSelectedIndex() ;
          
            if (txtBlockInSectorWrite.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBlockInSectorWrite.requestFocus();
                return;
            }
            if (txtBWSectorAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWSectorAddress.requestFocus();
                return;
            }
            if (txtBWBlockAddress.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWBlockAddress.requestFocus();
                return;
            }
            key_index = (byte) cboKeyIndex.getSelectedIndex();
           
            sector_address = Byte.parseByte(txtBWSectorAddress.getText());
            block_address = Byte.parseByte(txtBWBlockAddress.getText());
            write_data = txtBlockInSectorWrite.getText().getBytes();
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorWrite(write_data, sector_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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorWriteActionPerformed

    private void btnBlockInSectorWriteAKM1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorWriteAKM1ActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] write_data    = new byte[MAX_BLOCK_BYTES];
          
            if (txtBlockInSectorWriteAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBlockInSectorWriteAKM1.requestFocus();
                return;
            }
            if (txtBWSectorAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWSectorAddressAKM1.requestFocus();
                return;
            }
            if (txtBWBlockAddressAKM1.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWBlockAddressAKM1.requestFocus();
                return;
            }
            
            sector_address = Byte.parseByte(txtBWSectorAddressAKM1.getText());
            block_address  = Byte.parseByte(txtBWBlockAddressAKM1.getText());
            write_data     = txtBlockInSectorWriteAKM1.getText().getBytes();
            
            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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorWriteAKM1ActionPerformed

    private void btnBlockInSectorWriteAKM2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorWriteAKM2ActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] write_data    = new byte[MAX_BLOCK_BYTES];
          
            if (txtBlockInSectorWriteAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBlockInSectorWriteAKM2.requestFocus();
                return;
            }
            if (txtBWSectorAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWSectorAddressAKM2.requestFocus();
                return;
            }
            if (txtBWBlockAddressAKM2.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWBlockAddressAKM1.requestFocus();
                return;
            }

            sector_address = Byte.parseByte(txtBWSectorAddressAKM2.getText());
            block_address = Byte.parseByte(txtBWBlockAddressAKM2.getText());
            write_data = txtBlockInSectorWriteAKM2.getText().getBytes();
            
            iFResult = Declarations.UFrDeclarations.UFRInstance.BlockInSectorWrite_AKM2(write_data, sector_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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorWriteAKM2ActionPerformed

    private void btnBlockInSectorWritePKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBlockInSectorWritePKActionPerformed
        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 sector_address = 0;
          byte block_address  = 0;
          byte[] write_data   = new byte[MAX_BLOCK_BYTES];
          
            if (txtBlockInSectorWritePK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, ANY_DATA, "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBlockInSectorWritePK.requestFocus();
                return;
            }
            if (txtBWSectorAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  SECTOR_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWSectorAddressPK.requestFocus();
                return;
            }
            if (txtBWBlockAddressPK.getText().trim().isEmpty()) {
                JOptionPane.showMessageDialog(rootPane, "You must enter the  BLOCK_ADDRESS !", "Warning !", JOptionPane.WARNING_MESSAGE);
                txtBWBlockAddressPK.requestFocus();
                return;
            }
            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 ex) {
            JOptionPane.showMessageDialog(rootPane, APPROPRIATE_FORMAT, "Error !", JOptionPane.ERROR_MESSAGE);
        } finally {
            M.SetFunct(false);
        }
    }//GEN-LAST:event_btnBlockInSectorWritePKActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnBlockInSectorRead;
    private javax.swing.JButton btnBlockInSectorReadAKM1;
    private javax.swing.JButton btnBlockInSectorReadAKM2;
    private javax.swing.JButton btnBlockInSectorWrite;
    private javax.swing.JButton btnBlockInSectorWriteAKM1;
    private javax.swing.JButton btnBlockInSectorWriteAKM2;
    private javax.swing.JButton btnBlockInSectorWritePK;
    private javax.swing.JButton btnSectorAddressPK;
    private javax.swing.ButtonGroup btngAUTH1AB;
    private javax.swing.JComboBox cboKeyIndex;
    private javax.swing.JCheckBox chkBlockRead;
    private javax.swing.JCheckBox chkBlockRead1;
    private javax.swing.JCheckBox chkBlockRead2;
    private javax.swing.JCheckBox chkBlockRead3;
    private javax.swing.JCheckBox chkBlockRead4;
    private javax.swing.JCheckBox chkBlockRead5;
    private javax.swing.JCheckBox chkBlockRead6;
    private javax.swing.JCheckBox chkBlockRead7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel lblBRBlockAddress;
    private javax.swing.JLabel lblBRBlockAddressAKM1;
    private javax.swing.JLabel lblBRBlockAddressAKM2;
    private javax.swing.JLabel lblBRBlockAddressPK;
    private javax.swing.JLabel lblBRSectorAddress;
    private javax.swing.JLabel lblBRSectorAddressAKM1;
    private javax.swing.JLabel lblBRSectorAddressAKM2;
    private javax.swing.JLabel lblBRSectorAddressPK;
    private javax.swing.JLabel lblBWBlockAddress;
    private javax.swing.JLabel lblBWBlockAddressAKM1;
    private javax.swing.JLabel lblBWBlockAddressAKM2;
    private javax.swing.JLabel lblBWBlockAddressPK;
    private javax.swing.JLabel lblBWSectorAddress;
    private javax.swing.JLabel lblBWSectorAddressAKM1;
    private javax.swing.JLabel lblBWSectorAddressAKM2;
    private javax.swing.JLabel lblBWSectorAddressPK;
    private javax.swing.JLabel lblBlockInSectorRead;
    private javax.swing.JLabel lblBlockInSectorReadAKM1;
    private javax.swing.JLabel lblBlockInSectorReadAKM2;
    private javax.swing.JLabel lblBlockInSectorReadPK;
    private javax.swing.JLabel lblBlockInSectorWrite;
    private javax.swing.JLabel lblBlockInSectorWriteAKM1;
    private javax.swing.JLabel lblBlockInSectorWriteAKM2;
    private javax.swing.JLabel lblBlockInSectorWritePK;
    private javax.swing.JTextField lblFunction;
    private javax.swing.JLabel lblKeyIndex;
    private javax.swing.JLabel lblReadData;
    private javax.swing.JLabel lblReadDataAKM1;
    private javax.swing.JLabel lblReadDataAKM2;
    private javax.swing.JLabel lblReadDataPK;
    private javax.swing.JLabel lblWriteData;
    private javax.swing.JLabel lblWriteDataAKM1;
    private javax.swing.JLabel lblWriteDataAKM2;
    private javax.swing.JLabel lblWriteDataPK;
    private javax.swing.JTabbedPane pgBlockInSectorReadWrite;
    private javax.swing.JPanel pnlBlockInSectorRead;
    private javax.swing.JPanel pnlBlockInSectorReadAKM1;
    private javax.swing.JPanel pnlBlockInSectorReadAKM2;
    private javax.swing.JPanel pnlBlockInSectorReadPK;
    private javax.swing.JPanel pnlBlockInSectorWrite;
    private javax.swing.JPanel pnlBlockInSectorWriteAKM1;
    private javax.swing.JPanel pnlBlockInSectorWriteAKM2;
    private javax.swing.JPanel pnlBlockInSectorWritePK;
    private javax.swing.JPanel pnlHeader;
    private javax.swing.JRadioButton rbAUTH1A;
    private javax.swing.JRadioButton rbAUTH1B;
    private javax.swing.JPanel tabBlockInSectorRead;
    private javax.swing.JPanel tabBlockInSectorWrite;
    private javax.swing.JTextField txtBRBlockAddress;
    private javax.swing.JTextField txtBRBlockAddressAKM1;
    private javax.swing.JTextField txtBRBlockAddressAKM2;
    private javax.swing.JTextField txtBRBlockAddressPK;
    private javax.swing.JTextField txtBRSectorAddress;
    private javax.swing.JTextField txtBRSectorAddressAKM1;
    private javax.swing.JTextField txtBRSectorAddressAKM2;
    private javax.swing.JTextField txtBRSectorAddressPK;
    private javax.swing.JTextField txtBWBlockAddress;
    private javax.swing.JTextField txtBWBlockAddressAKM1;
    private javax.swing.JTextField txtBWBlockAddressAKM2;
    private javax.swing.JTextField txtBWBlockAddressPK;
    private javax.swing.JTextField txtBWSectorAddress;
    private javax.swing.JTextField txtBWSectorAddressAKM1;
    private javax.swing.JTextField txtBWSectorAddressAKM2;
    private javax.swing.JTextField txtBWSectorAddressPK;
    private javax.swing.JTextField txtBlockInSectorRead;
    private javax.swing.JTextField txtBlockInSectorReadAKM1;
    private javax.swing.JTextField txtBlockInSectorReadAKM2;
    private javax.swing.JTextField txtBlockInSectorReadPK;
    private javax.swing.JTextField txtBlockInSectorWrite;
    private javax.swing.JTextField txtBlockInSectorWriteAKM1;
    private javax.swing.JTextField txtBlockInSectorWriteAKM2;
    private javax.swing.JTextField txtBlockInSectorWritePK;
    private javax.swing.JTextField txtFErrorCode;
    private javax.swing.JTextField txtFErrorExplain;
    // End of variables declaration//GEN-END:variables
}
