/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui;

import java.awt.Dimension;
import java.awt.Toolkit;

//import Reader.ReaderAPI;
import java.awt.Image;
import java.awt.Rectangle;
import java.io.File;
import java.io.IOException;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.channels.DatagramChannel;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.charset.Charset;
import java.util.*;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;
import java.util.Date;
import java.text.SimpleDateFormat;

import com.sun.jna.Native;
import sdk.Utility;
import sdk.READERDLLAPI;
import sdk.READERDLLAPI.READERDLL;
import sdk.READERDLLAPI.READERDLL.BYTEA;
import sdk.READERDLLAPI.READERDLL.HandsetParam;
import sdk.READERDLLAPI.READERDLL.MyCallInterface;
import sdk.READERDLLAPI.READERDLL.MyCallInterfaceTest;
import sdk.READERDLLAPI.READERDLL.ReaderDate;


/**
 *
 * @author mt
 */
public class JDialogDemo extends javax.swing.JDialog {

    int hScanner[] = new int[1];
    int res;
    //static ReaderAPI Reader;
    READERDLLAPI.READERDLL ReaderAPI = null;
    String LogFileName;

    int		m_Port;//Reader Port
    int		m_HostPort;//Host Port
    int ConnectMode		=	-1;//连接的模式,0---网口，1---RS232，2---RS485
    int ifConnectReader=	0;//读写器是否连接，1---连接,0---没有连接
    int NewConnect		=	0;
    int Address                 =       0;



    int nIDEvent = 1;//是哪个事ID号
    int mem=0;//哪个区,EPC,TID,USER,PASSWORD
    int ptr=0;//从哪儿开始
    int len=0;//取多长
    int EPC_Word=0; //epc length
    int m_antenna_sel;
    byte[] AccessPassword = new byte[4];
    int[] gAntenna = new int[4];//add by mqs 20130710
    int iModAnt;	//选中的个数
    int Read_times=0;
    int iPlatform	=	0;	//0---626, 1---218

    byte[][] EPCC1G2_IDBuffer = new byte[100][96];

    //将字符串变为字节数组
    byte[] mask = new byte[512];//掩措
    byte[] IDTemp = new byte[512];
    static int timer_interval=1000 ;//定时器间隔


    private MyTimer mytimer=new MyTimer();
    static boolean running = true;//定时器使用

    DefaultListModel hlistModel=null;

    private MyTimerAuto mytimerAuto=new MyTimerAuto();
    private MyTimerSerialAuto mytimerSerialAuto=new MyTimerSerialAuto();
    int iTagNumber = 0;//auto下的tag的个数
    private static boolean bound = false;
    DatagramChannel channel = null;  
    DatagramSocket socket = null;
    int iHostPort = 5000; //auto host port
            
    byte HVer1;
    byte HVer2;
    byte SVer1;
    byte SVer2;    
    HandsetParam gHandParam[] = new HandsetParam[1];
    static JDialogDemo dialog = null;
    
    /**
     * Creates new form JDialogDemo
     */
    public JDialogDemo(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }

    private JDialogDemo() {
        throw new UnsupportedOperationException("Not yet implemented");
    }

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

        buttonGroup1 = new javax.swing.ButtonGroup();
        buttonGroup2 = new javax.swing.ButtonGroup();
        buttonGroup3 = new javax.swing.ButtonGroup();
        buttonGroup4 = new javax.swing.ButtonGroup();
        buttonGroup5 = new javax.swing.ButtonGroup();
        buttonGroup6 = new javax.swing.ButtonGroup();
        buttonGroup7 = new javax.swing.ButtonGroup();
        buttonGroup8 = new javax.swing.ButtonGroup();
        buttonGroup9 = new javax.swing.ButtonGroup();
        jTabbedPane = new javax.swing.JTabbedPane();
        jPanel_connect = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jComboBox_ports = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jButton_connect = new javax.swing.JButton();
        jButton_disconnect = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jRadioButton1 = new javax.swing.JRadioButton();
        jRadioButton2 = new javax.swing.JRadioButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jTextField4 = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jPanel_ReaderParam = new javax.swing.JPanel();
        jPanel26 = new javax.swing.JPanel();
        jPanel25 = new javax.swing.JPanel();
        jLabel20 = new javax.swing.JLabel();
        jTextField18 = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton7 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jPanel27 = new javax.swing.JPanel();
        jRadioButton24 = new javax.swing.JRadioButton();
        jRadioButton25 = new javax.swing.JRadioButton();
        jPanel28 = new javax.swing.JPanel();
        jRadioButton26 = new javax.swing.JRadioButton();
        jRadioButton27 = new javax.swing.JRadioButton();
        jRadioButton28 = new javax.swing.JRadioButton();
        jPanel29 = new javax.swing.JPanel();
        jCheckBox5 = new javax.swing.JCheckBox();
        jLabel21 = new javax.swing.JLabel();
        jTextField19 = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jTextField20 = new javax.swing.JTextField();
        jPanel30 = new javax.swing.JPanel();
        jCheckBox6 = new javax.swing.JCheckBox();
        jLabel23 = new javax.swing.JLabel();
        jTextField21 = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jTextField22 = new javax.swing.JTextField();
        jCheckBox7 = new javax.swing.JCheckBox();
        jCheckBox8 = new javax.swing.JCheckBox();
        jCheckBox9 = new javax.swing.JCheckBox();
        jPanel31 = new javax.swing.JPanel();
        jTextField23 = new javax.swing.JTextField();
        jButton12 = new javax.swing.JButton();
        jButton13 = new javax.swing.JButton();
        jPanel32 = new javax.swing.JPanel();
        jLabel25 = new javax.swing.JLabel();
        jTextField24 = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jTextField25 = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jTextField26 = new javax.swing.JTextField();
        jButton14 = new javax.swing.JButton();
        jButton15 = new javax.swing.JButton();
        jPanel33 = new javax.swing.JPanel();
        jLabel28 = new javax.swing.JLabel();
        jComboBox8 = new javax.swing.JComboBox();
        jLabel29 = new javax.swing.JLabel();
        jComboBox9 = new javax.swing.JComboBox();
        jLabel30 = new javax.swing.JLabel();
        jComboBox10 = new javax.swing.JComboBox();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jTextField27 = new javax.swing.JTextField();
        jTextField28 = new javax.swing.JTextField();
        jTextField29 = new javax.swing.JTextField();
        jButton16 = new javax.swing.JButton();
        jButton17 = new javax.swing.JButton();
        jLabel34 = new javax.swing.JLabel();
        jTextField30 = new javax.swing.JTextField();
        jPanel_BlueTooth = new javax.swing.JPanel();
        jPanel34 = new javax.swing.JPanel();
        jLabel35 = new javax.swing.JLabel();
        jTextField31 = new javax.swing.JTextField();
        jLabel36 = new javax.swing.JLabel();
        jButton18 = new javax.swing.JButton();
        jButton19 = new javax.swing.JButton();
        jButton20 = new javax.swing.JButton();
        jButton21 = new javax.swing.JButton();
        jComboBox11 = new javax.swing.JComboBox();
        jPanel_Data = new javax.swing.JPanel();
        jPanel35 = new javax.swing.JPanel();
        jLabel37 = new javax.swing.JLabel();
        jTextField33 = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        jTextField34 = new javax.swing.JTextField();
        jButton22 = new javax.swing.JButton();
        jButton23 = new javax.swing.JButton();
        jCheckBox10 = new javax.swing.JCheckBox();
        jButton24 = new javax.swing.JButton();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jPanel36 = new javax.swing.JPanel();
        jTextField35 = new javax.swing.JTextField();
        jButton25 = new javax.swing.JButton();
        jButton26 = new javax.swing.JButton();
        jScrollPane6 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jButton27 = new javax.swing.JButton();
        jButton28 = new javax.swing.JButton();
        jButton29 = new javax.swing.JButton();
        jButton30 = new javax.swing.JButton();
        jButton31 = new javax.swing.JButton();
        jProgressBar1 = new javax.swing.JProgressBar();
        jPanel_ISO18000_6C = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jCheckBox1 = new javax.swing.JCheckBox();
        jCheckBox2 = new javax.swing.JCheckBox();
        jCheckBox3 = new javax.swing.JCheckBox();
        jCheckBox4 = new javax.swing.JCheckBox();
        jPanel4 = new javax.swing.JPanel();
        jComboBox1 = new javax.swing.JComboBox();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jPanel7 = new javax.swing.JPanel();
        jPanel8 = new javax.swing.JPanel();
        jRadioButton3 = new javax.swing.JRadioButton();
        jLabel6 = new javax.swing.JLabel();
        jTextField5 = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        jTextField6 = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jTextField7 = new javax.swing.JTextField();
        jToggleButton1 = new javax.swing.JToggleButton();
        jPanel9 = new javax.swing.JPanel();
        jPanel10 = new javax.swing.JPanel();
        jComboBox2 = new javax.swing.JComboBox();
        jLabel9 = new javax.swing.JLabel();
        jTextField8 = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jPanel11 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        jComboBox3 = new javax.swing.JComboBox();
        jPanel13 = new javax.swing.JPanel();
        jRadioButton4 = new javax.swing.JRadioButton();
        jRadioButton5 = new javax.swing.JRadioButton();
        jRadioButton6 = new javax.swing.JRadioButton();
        jRadioButton7 = new javax.swing.JRadioButton();
        jLabel10 = new javax.swing.JLabel();
        jTextField9 = new javax.swing.JTextField();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jButton4 = new javax.swing.JButton();
        jLabel11 = new javax.swing.JLabel();
        jTextField10 = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jTextField11 = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jTextField12 = new javax.swing.JTextField();
        jToggleButton2 = new javax.swing.JToggleButton();
        jScrollPane3 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();
        jPanel14 = new javax.swing.JPanel();
        jPanel18 = new javax.swing.JPanel();
        jRadioButton10 = new javax.swing.JRadioButton();
        jRadioButton11 = new javax.swing.JRadioButton();
        jRadioButton12 = new javax.swing.JRadioButton();
        jRadioButton13 = new javax.swing.JRadioButton();
        jPanel19 = new javax.swing.JPanel();
        jComboBox6 = new javax.swing.JComboBox();
        jPanel20 = new javax.swing.JPanel();
        jPanel21 = new javax.swing.JPanel();
        jRadioButton14 = new javax.swing.JRadioButton();
        jRadioButton15 = new javax.swing.JRadioButton();
        jRadioButton16 = new javax.swing.JRadioButton();
        jRadioButton17 = new javax.swing.JRadioButton();
        jRadioButton18 = new javax.swing.JRadioButton();
        jRadioButton19 = new javax.swing.JRadioButton();
        jPanel22 = new javax.swing.JPanel();
        jRadioButton20 = new javax.swing.JRadioButton();
        jRadioButton21 = new javax.swing.JRadioButton();
        jRadioButton22 = new javax.swing.JRadioButton();
        jRadioButton23 = new javax.swing.JRadioButton();
        jLabel17 = new javax.swing.JLabel();
        jTextField16 = new javax.swing.JTextField();
        jButton8 = new javax.swing.JButton();
        jPanel15 = new javax.swing.JPanel();
        jComboBox4 = new javax.swing.JComboBox();
        jLabel14 = new javax.swing.JLabel();
        jTextField13 = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTextField14 = new javax.swing.JTextField();
        jButton5 = new javax.swing.JButton();
        jPanel16 = new javax.swing.JPanel();
        jComboBox5 = new javax.swing.JComboBox();
        jPanel17 = new javax.swing.JPanel();
        jRadioButton8 = new javax.swing.JRadioButton();
        jRadioButton9 = new javax.swing.JRadioButton();
        jLabel16 = new javax.swing.JLabel();
        jTextField15 = new javax.swing.JTextField();
        jButton6 = new javax.swing.JButton();
        jToggleButton3 = new javax.swing.JToggleButton();
        jLabel19 = new javax.swing.JLabel();
        jPanel23 = new javax.swing.JPanel();
        jPanel24 = new javax.swing.JPanel();
        jComboBox7 = new javax.swing.JComboBox();
        jLabel18 = new javax.swing.JLabel();
        jTextField17 = new javax.swing.JTextField();
        jButton9 = new javax.swing.JButton();
        jButton10 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jTabbedPane.setBackground(new java.awt.Color(255, 204, 255));
        jTabbedPane.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                jTabbedPaneStateChanged(evt);
            }
        });
        jTabbedPane.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTabbedPaneFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTabbedPaneFocusLost(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder("RS232"));

        jComboBox_ports.setEditable(true);

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("ui/Bundle"); // NOI18N
        jLabel1.setText(bundle.getString("IDWQE_B0007")); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
                .addComponent(jComboBox_ports, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jComboBox_ports, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jButton_connect.setText(bundle.getString("IDWQE_B0002")); // NOI18N
        jButton_connect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_connectActionPerformed(evt);
            }
        });

        jButton_disconnect.setText(bundle.getString("IDWQE_B0005")); // NOI18N
        jButton_disconnect.setEnabled(false);
        jButton_disconnect.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton_disconnectActionPerformed(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Connect Mode"));

        buttonGroup1.add(jRadioButton1);
        jRadioButton1.setText("USB");
        jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton1ActionPerformed(evt);
            }
        });

        buttonGroup1.add(jRadioButton2);
        jRadioButton2.setText("RS232");
        jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jRadioButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE)
                .addComponent(jRadioButton2)
                .addGap(39, 39, 39))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton1)
                    .addComponent(jRadioButton2))
                .addContainerGap(40, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("TCP/IP"));

        jLabel2.setText("Reader IP Address:");

        jTextField1.setText("192.168.0.103");

        jLabel3.setText("Reader Port:");

        jLabel4.setText("Host IP Address:");

        jTextField3.setText("127.0.0.1");

        jTextField4.setText("5555");

        jLabel5.setText("Host Port:");

        jTextField2.setText("1969");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 166, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))))
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField3)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(22, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel_connectLayout = new javax.swing.GroupLayout(jPanel_connect);
        jPanel_connect.setLayout(jPanel_connectLayout);
        jPanel_connectLayout.setHorizontalGroup(
            jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_connectLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel_connectLayout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 402, Short.MAX_VALUE)
                        .addComponent(jButton_connect, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton_disconnect, javax.swing.GroupLayout.PREFERRED_SIZE, 144, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel_connectLayout.createSequentialGroup()
                        .addGroup(jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel_connectLayout.setVerticalGroup(
            jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_connectLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel_connectLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jButton_connect, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton_disconnect, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel_connectLayout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(434, Short.MAX_VALUE))
        );

        jTabbedPane.addTab("Connect Reader", jPanel_connect);

        jPanel26.setBorder(javax.swing.BorderFactory.createTitledBorder("Basic Param"));

        jPanel25.setBorder(javax.swing.BorderFactory.createTitledBorder("Handset ID number"));

        jLabel20.setText("ID:");

        jButton1.setText("Get ID");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton3.setText("Set ID");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel25Layout = new javax.swing.GroupLayout(jPanel25);
        jPanel25.setLayout(jPanel25Layout);
        jPanel25Layout.setHorizontalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel20)
                .addGap(27, 27, 27)
                .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, 118, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel25Layout.setVerticalGroup(
            jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel25Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addContainerGap())
            .addGroup(jPanel25Layout.createSequentialGroup()
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton3)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jButton7.setText("Write Param");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

        jButton11.setText("Read Param");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        jPanel27.setBorder(javax.swing.BorderFactory.createTitledBorder("Type Tag"));

        buttonGroup2.add(jRadioButton24);
        jRadioButton24.setLabel("ISO18000-6B");

        buttonGroup2.add(jRadioButton25);
        jRadioButton25.setText("ISO18000-6C");

        javax.swing.GroupLayout jPanel27Layout = new javax.swing.GroupLayout(jPanel27);
        jPanel27.setLayout(jPanel27Layout);
        jPanel27Layout.setHorizontalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addComponent(jRadioButton24)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jRadioButton25)
                .addGap(72, 72, 72))
        );
        jPanel27Layout.setVerticalGroup(
            jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel27Layout.createSequentialGroup()
                .addGroup(jPanel27Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton24)
                    .addComponent(jRadioButton25))
                .addGap(0, 6, Short.MAX_VALUE))
        );

        jPanel28.setBorder(javax.swing.BorderFactory.createTitledBorder("Output form"));

        buttonGroup3.add(jRadioButton26);
        jRadioButton26.setText("Save and Output");

        buttonGroup3.add(jRadioButton27);
        jRadioButton27.setText("Save");

        buttonGroup3.add(jRadioButton28);
        jRadioButton28.setText("Ouput");

        javax.swing.GroupLayout jPanel28Layout = new javax.swing.GroupLayout(jPanel28);
        jPanel28.setLayout(jPanel28Layout);
        jPanel28Layout.setHorizontalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jRadioButton26)
                .addGap(39, 39, 39)
                .addComponent(jRadioButton27)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jRadioButton28)
                .addGap(28, 28, 28))
        );
        jPanel28Layout.setVerticalGroup(
            jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel28Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel28Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton26)
                    .addComponent(jRadioButton27)
                    .addComponent(jRadioButton28))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel29.setBorder(javax.swing.BorderFactory.createTitledBorder("TID Part"));

        jCheckBox5.setText("TID");

        jLabel21.setText("Start");

        jLabel22.setText("Length");

        javax.swing.GroupLayout jPanel29Layout = new javax.swing.GroupLayout(jPanel29);
        jPanel29.setLayout(jPanel29Layout);
        jPanel29Layout.setHorizontalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addComponent(jCheckBox5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel22)
                .addGap(18, 18, 18)
                .addComponent(jTextField20))
        );
        jPanel29Layout.setVerticalGroup(
            jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel29Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel29Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox5)
                    .addComponent(jLabel21)
                    .addComponent(jTextField19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(jTextField20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jPanel30.setBorder(javax.swing.BorderFactory.createTitledBorder("User Part"));

        jCheckBox6.setText("User");

        jLabel23.setText("Start");

        jLabel24.setText("Length");

        javax.swing.GroupLayout jPanel30Layout = new javax.swing.GroupLayout(jPanel30);
        jPanel30.setLayout(jPanel30Layout);
        jPanel30Layout.setHorizontalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addComponent(jCheckBox6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel23)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel24)
                .addGap(18, 18, 18)
                .addComponent(jTextField22))
        );
        jPanel30Layout.setVerticalGroup(
            jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel30Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel30Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox6)
                    .addComponent(jLabel23)
                    .addComponent(jTextField21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24)
                    .addComponent(jTextField22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(29, Short.MAX_VALUE))
        );

        jCheckBox7.setText("Vibrate");

        jCheckBox8.setText("Enable Name");

        jCheckBox9.setText("Enable Alarm");

        javax.swing.GroupLayout jPanel26Layout = new javax.swing.GroupLayout(jPanel26);
        jPanel26.setLayout(jPanel26Layout);
        jPanel26Layout.setHorizontalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel26Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel30, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel26Layout.createSequentialGroup()
                        .addGap(56, 56, 56)
                        .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton7, javax.swing.GroupLayout.DEFAULT_SIZE, 115, Short.MAX_VALUE)
                            .addComponent(jButton11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel26Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCheckBox8)
                            .addComponent(jCheckBox7)
                            .addComponent(jCheckBox9))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel26Layout.setVerticalGroup(
            jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel26Layout.createSequentialGroup()
                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel26Layout.createSequentialGroup()
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton11, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanel25, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGroup(jPanel26Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel26Layout.createSequentialGroup()
                        .addGap(151, 151, 151)
                        .addComponent(jCheckBox7)
                        .addGap(18, 18, 18)
                        .addComponent(jCheckBox8)
                        .addGap(18, 18, 18)
                        .addComponent(jCheckBox9)
                        .addContainerGap())
                    .addGroup(jPanel26Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addComponent(jPanel27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );

        jPanel31.setBorder(javax.swing.BorderFactory.createTitledBorder("SetTime"));

        jButton12.setText("GetTime");
        jButton12.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton12ActionPerformed(evt);
            }
        });

        jButton13.setText("SetTime");
        jButton13.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton13ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel31Layout = new javax.swing.GroupLayout(jPanel31);
        jPanel31.setLayout(jPanel31Layout);
        jPanel31Layout.setHorizontalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 431, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton12, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton13, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(19, 19, 19))
        );
        jPanel31Layout.setVerticalGroup(
            jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel31Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel31Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel31Layout.createSequentialGroup()
                        .addComponent(jButton12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton13))
                    .addComponent(jTextField23, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel32.setBorder(javax.swing.BorderFactory.createTitledBorder("Mask"));

        jLabel25.setText("Start Address");

        jLabel26.setText("Length");

        jLabel27.setText("Mask(HEX)");

        jButton14.setText("SetFilter");
        jButton14.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton14ActionPerformed(evt);
            }
        });

        jButton15.setText("GetFilter");
        jButton15.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton15ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel32Layout = new javax.swing.GroupLayout(jPanel32);
        jPanel32.setLayout(jPanel32Layout);
        jPanel32Layout.setHorizontalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel32Layout.createSequentialGroup()
                        .addComponent(jLabel25)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jLabel26)
                        .addGap(32, 32, 32)
                        .addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel32Layout.createSequentialGroup()
                        .addComponent(jLabel27)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, 321, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(32, 32, 32)
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton14)
                    .addComponent(jButton15))
                .addGap(0, 63, Short.MAX_VALUE))
        );
        jPanel32Layout.setVerticalGroup(
            jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel32Layout.createSequentialGroup()
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(jTextField24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26)
                    .addComponent(jTextField25, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton14))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel27)
                    .addGroup(jPanel32Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jTextField26, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton15)))
                .addGap(0, 8, Short.MAX_VALUE))
        );

        jPanel33.setBorder(javax.swing.BorderFactory.createTitledBorder("RF moudle parameters"));

        jLabel28.setText("UsbRate");

        jComboBox8.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel29.setText("Frequency Min");

        jComboBox9.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel30.setText("Frequency Max");

        jComboBox10.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel31.setText("RF Hardware Ver");

        jLabel32.setText("RF Software Ver");

        jLabel33.setText("RF Power Output");

        jButton16.setText("Read Param");
        jButton16.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton16ActionPerformed(evt);
            }
        });

        jButton17.setText("Write Param");
        jButton17.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton17ActionPerformed(evt);
            }
        });

        jLabel34.setText("Moudle");

        javax.swing.GroupLayout jPanel33Layout = new javax.swing.GroupLayout(jPanel33);
        jPanel33.setLayout(jPanel33Layout);
        jPanel33Layout.setHorizontalGroup(
            jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel33Layout.createSequentialGroup()
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel28)
                    .addComponent(jLabel29)
                    .addComponent(jLabel30))
                .addGap(35, 35, 35)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(58, 58, 58)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel31)
                    .addComponent(jLabel32)
                    .addComponent(jLabel33))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField29)
                    .addComponent(jTextField28)
                    .addComponent(jTextField27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel33Layout.createSequentialGroup()
                        .addComponent(jLabel34)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jButton17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel33Layout.setVerticalGroup(
            jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel33Layout.createSequentialGroup()
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel28)
                    .addComponent(jComboBox8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31)
                    .addComponent(jTextField27, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton16))
                .addGap(18, 18, 18)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel29)
                    .addComponent(jComboBox9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)
                    .addComponent(jTextField28, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton17))
                .addGap(18, 18, 18)
                .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel30)
                    .addGroup(jPanel33Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jComboBox10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel33)
                        .addComponent(jTextField29, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel34)
                        .addComponent(jTextField30, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(0, 20, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel_ReaderParamLayout = new javax.swing.GroupLayout(jPanel_ReaderParam);
        jPanel_ReaderParam.setLayout(jPanel_ReaderParamLayout);
        jPanel_ReaderParamLayout.setHorizontalGroup(
            jPanel_ReaderParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_ReaderParamLayout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel_ReaderParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel32, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel31, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel26, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel33, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(333, Short.MAX_VALUE))
        );
        jPanel_ReaderParamLayout.setVerticalGroup(
            jPanel_ReaderParamLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_ReaderParamLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel26, javax.swing.GroupLayout.PREFERRED_SIZE, 434, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel32, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(49, Short.MAX_VALUE))
        );

        jPanel26.getAccessibleContext().setAccessibleName("BasicParam");

        jTabbedPane.addTab("ReaderParam", jPanel_ReaderParam);

        jPanel34.setBorder(javax.swing.BorderFactory.createTitledBorder("BlueTooth"));

        jLabel35.setText("BlueToothName");

        jLabel36.setText("BlueToothRate");

        jButton18.setText("SetBlueToothName");
        jButton18.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton18ActionPerformed(evt);
            }
        });

        jButton19.setText("GetBlueToothName");
        jButton19.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton19ActionPerformed(evt);
            }
        });

        jButton20.setText("SetBlueToothRate");
        jButton20.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton20ActionPerformed(evt);
            }
        });

        jButton21.setText("GetBlueToothRate");
        jButton21.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton21ActionPerformed(evt);
            }
        });

        jComboBox11.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel34Layout = new javax.swing.GroupLayout(jPanel34);
        jPanel34.setLayout(jPanel34Layout);
        jPanel34Layout.setHorizontalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel35, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel36))
                .addGap(32, 32, 32)
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField31)
                    .addComponent(jComboBox11, 0, 99, Short.MAX_VALUE))
                .addGap(62, 62, 62)
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton18)
                    .addComponent(jButton20))
                .addGap(53, 53, 53)
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton21)
                    .addComponent(jButton19))
                .addContainerGap(113, Short.MAX_VALUE))
        );
        jPanel34Layout.setVerticalGroup(
            jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel34Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel35)
                    .addComponent(jTextField31, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton18)
                    .addComponent(jButton19))
                .addGap(30, 30, 30)
                .addGroup(jPanel34Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel36)
                    .addComponent(jButton20)
                    .addComponent(jButton21)
                    .addComponent(jComboBox11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(82, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel_BlueToothLayout = new javax.swing.GroupLayout(jPanel_BlueTooth);
        jPanel_BlueTooth.setLayout(jPanel_BlueToothLayout);
        jPanel_BlueToothLayout.setHorizontalGroup(
            jPanel_BlueToothLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_BlueToothLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(186, Short.MAX_VALUE))
        );
        jPanel_BlueToothLayout.setVerticalGroup(
            jPanel_BlueToothLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_BlueToothLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(663, Short.MAX_VALUE))
        );

        jTabbedPane.addTab("BlueTooth", jPanel_BlueTooth);

        jPanel35.setBorder(javax.swing.BorderFactory.createTitledBorder("Download"));

        jLabel37.setText("Start Time");

        jLabel38.setText("End Time");

        jButton22.setText("Download");
        jButton22.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton22ActionPerformed(evt);
            }
        });

        jButton23.setText("Delete");
        jButton23.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton23ActionPerformed(evt);
            }
        });

        jCheckBox10.setText("Whether to read all the records");

        jButton24.setText("DownLoad High");
        jButton24.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton24ActionPerformed(evt);
            }
        });

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "No.", "Date", "EPC", "TID", "User"
            }
        ));
        jScrollPane4.setViewportView(jTable2);

        javax.swing.GroupLayout jPanel35Layout = new javax.swing.GroupLayout(jPanel35);
        jPanel35.setLayout(jPanel35Layout);
        jPanel35Layout.setHorizontalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel35Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane4)
                    .addGroup(jPanel35Layout.createSequentialGroup()
                        .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel35Layout.createSequentialGroup()
                                .addComponent(jLabel37)
                                .addGap(40, 40, 40)
                                .addComponent(jTextField33, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jLabel38)
                                .addGap(29, 29, 29)
                                .addComponent(jTextField34, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jCheckBox10))
                        .addGap(78, 78, 78)
                        .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel35Layout.createSequentialGroup()
                                .addComponent(jButton22)
                                .addGap(27, 27, 27)
                                .addComponent(jButton23))
                            .addComponent(jButton24))))
                .addContainerGap(34, Short.MAX_VALUE))
        );
        jPanel35Layout.setVerticalGroup(
            jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel35Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(jTextField33, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel38)
                    .addComponent(jTextField34, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton22)
                    .addComponent(jButton23))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel35Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCheckBox10)
                    .addComponent(jButton24))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(244, 244, 244))
        );

        jPanel36.setBorder(javax.swing.BorderFactory.createTitledBorder("List of Name"));

        jButton25.setText("Add");
        jButton25.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton25ActionPerformed(evt);
            }
        });

        jButton26.setText("Del");
        jButton26.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton26ActionPerformed(evt);
            }
        });

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null},
                {null, null, null},
                {null, null, null}
            },
            new String [] {
                "NO.", "ID", ""
            }
        ));
        jScrollPane6.setViewportView(jTable3);

        jButton27.setText("GetName");
        jButton27.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton27ActionPerformed(evt);
            }
        });

        jButton28.setText("DelName");
        jButton28.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton28ActionPerformed(evt);
            }
        });

        jButton29.setText("AddName");
        jButton29.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton29ActionPerformed(evt);
            }
        });

        jButton30.setText("SaveName");
        jButton30.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton30ActionPerformed(evt);
            }
        });

        jButton31.setText("Del Single Name");
        jButton31.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton31ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel36Layout = new javax.swing.GroupLayout(jPanel36);
        jPanel36.setLayout(jPanel36Layout);
        jPanel36Layout.setHorizontalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel36Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel36Layout.createSequentialGroup()
                        .addComponent(jTextField35)
                        .addGap(61, 61, 61)
                        .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.DEFAULT_SIZE, 646, Short.MAX_VALUE))
                .addGap(18, 18, 18)
                .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel36Layout.createSequentialGroup()
                        .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton30, javax.swing.GroupLayout.DEFAULT_SIZE, 108, Short.MAX_VALUE)
                            .addComponent(jButton29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton28, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton27, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(0, 20, Short.MAX_VALUE))
                    .addComponent(jButton31, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );
        jPanel36Layout.setVerticalGroup(
            jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel36Layout.createSequentialGroup()
                .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextField35, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton25, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton26, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(18, 18, 18)
                .addGroup(jPanel36Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel36Layout.createSequentialGroup()
                        .addComponent(jButton27)
                        .addGap(18, 18, 18)
                        .addComponent(jButton28)
                        .addGap(18, 18, 18)
                        .addComponent(jButton29)
                        .addGap(18, 18, 18)
                        .addComponent(jButton30)
                        .addGap(18, 18, 18)
                        .addComponent(jButton31))
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel_DataLayout = new javax.swing.GroupLayout(jPanel_Data);
        jPanel_Data.setLayout(jPanel_DataLayout);
        jPanel_DataLayout.setHorizontalGroup(
            jPanel_DataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_DataLayout.createSequentialGroup()
                .addGroup(jPanel_DataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel35, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel36, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 110, Short.MAX_VALUE))
        );
        jPanel_DataLayout.setVerticalGroup(
            jPanel_DataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_DataLayout.createSequentialGroup()
                .addComponent(jPanel35, javax.swing.GroupLayout.PREFERRED_SIZE, 321, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel36, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 182, Short.MAX_VALUE))
        );

        jTabbedPane.addTab("Data", jPanel_Data);

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Select Antenna for Test"));

        jCheckBox1.setText("ANT1");

        jCheckBox2.setText("ANT2");

        jCheckBox3.setText("ANT3");

        jCheckBox4.setText("ANT4");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jCheckBox1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jCheckBox2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jCheckBox3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jCheckBox4))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jCheckBox1)
                .addComponent(jCheckBox2)
                .addComponent(jCheckBox3)
                .addComponent(jCheckBox4))
        );

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Read Interval"));

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

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

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("List EPC of Tags"));

        jTable1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "NO.", "ID", "Success", "Times", "Length"
            }
        ));
        jScrollPane1.setViewportView(jTable1);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jScrollPane1)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder("List Selected Tag"));

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder("Select Memory Bank"));

        jRadioButton3.setText("EPC");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jRadioButton3)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addComponent(jRadioButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jLabel6.setText("Address of Tag Data(bit):");

        jTextField5.setText("0");

        jLabel7.setText("Length of Tag Data(bit):");

        jTextField6.setText("0");

        jLabel8.setText("Tag Data(HEX):");

        jToggleButton1.setText("List EPC of Tag");
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jLabel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField6)
                            .addComponent(jTextField5)))
                    .addComponent(jTextField7)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel8)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addGap(50, 50, 50)
                                .addComponent(jToggleButton1)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jToggleButton1)
                .addGap(108, 108, 108))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder("Kill Tag"));

        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder("Select a Tag"));

        jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addContainerGap(12, Short.MAX_VALUE)
                .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 174, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jLabel9.setText("Kill Password (8HEX):");

        jButton2.setText("Kill  Tag");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jButton2)))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel9)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2)))
        );

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder("Read and Write Data Block"));

        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder("Select a Tag"));

        jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, 207, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder("Select Memory Bank"));

        jRadioButton4.setText("Password");

        jRadioButton5.setText("EPC");

        jRadioButton6.setText("TID");

        jRadioButton7.setText("User");

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addComponent(jRadioButton4)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 18, Short.MAX_VALUE)
                .addComponent(jRadioButton6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton4)
                    .addComponent(jRadioButton5)
                    .addComponent(jRadioButton6)
                    .addComponent(jRadioButton7))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jLabel10.setText("Address of Tag Data(WORD):");

        jTextField9.setText("0");

        jTextArea1.setColumns(20);
        jTextArea1.setRows(5);
        jScrollPane2.setViewportView(jTextArea1);

        jButton4.setText("Write");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jLabel11.setText("Length of Tag Data(WORD):");

        jTextField10.setText("1");

        jLabel12.setText("Access Password(8HEX):");

        jTextField11.setText("00000000");

        jLabel13.setText("Written Data(HEX):");

        jToggleButton2.setText("Read");
        jToggleButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton2ActionPerformed(evt);
            }
        });

        jScrollPane3.setViewportView(jList1);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabel10)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jTextField9))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addComponent(jLabel11)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jTextField10))
                            .addGroup(jPanel11Layout.createSequentialGroup()
                                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(jPanel11Layout.createSequentialGroup()
                                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel12)
                                            .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jScrollPane3)))
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jToggleButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4)))
                .addContainerGap())
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(20, 20, 20)
                        .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(jTextField11, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel13)
                        .addComponent(jTextField12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton4)
                        .addComponent(jToggleButton2)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel14.setBorder(javax.swing.BorderFactory.createTitledBorder("Set protect for reading or writing"));

        jPanel18.setBorder(javax.swing.BorderFactory.createTitledBorder("Select Memory Bank"));

        buttonGroup4.add(jRadioButton10);
        jRadioButton10.setText("Password");

        buttonGroup4.add(jRadioButton11);
        jRadioButton11.setText("EPC");

        buttonGroup4.add(jRadioButton12);
        jRadioButton12.setText("TID");

        buttonGroup4.add(jRadioButton13);
        jRadioButton13.setText("User");

        javax.swing.GroupLayout jPanel18Layout = new javax.swing.GroupLayout(jPanel18);
        jPanel18.setLayout(jPanel18Layout);
        jPanel18Layout.setHorizontalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addComponent(jRadioButton10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton11)
                .addGap(18, 18, 18)
                .addComponent(jRadioButton12)
                .addGap(18, 18, 18)
                .addComponent(jRadioButton13, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel18Layout.setVerticalGroup(
            jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel18Layout.createSequentialGroup()
                .addGroup(jPanel18Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton10)
                    .addComponent(jRadioButton11)
                    .addComponent(jRadioButton12)
                    .addComponent(jRadioButton13))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanel19.setBorder(javax.swing.BorderFactory.createTitledBorder("Select a Tag"));

        jComboBox6.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel19Layout = new javax.swing.GroupLayout(jPanel19);
        jPanel19.setLayout(jPanel19Layout);
        jPanel19Layout.setHorizontalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel19Layout.createSequentialGroup()
                .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, 154, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel19Layout.setVerticalGroup(
            jPanel19Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jComboBox6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel20.setBorder(javax.swing.BorderFactory.createTitledBorder("Lock of Password"));

        jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder("Password"));

        buttonGroup5.add(jRadioButton14);
        jRadioButton14.setText("Kill Password");

        buttonGroup5.add(jRadioButton15);
        jRadioButton15.setText("Access Password");

        javax.swing.GroupLayout jPanel21Layout = new javax.swing.GroupLayout(jPanel21);
        jPanel21.setLayout(jPanel21Layout);
        jPanel21Layout.setHorizontalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel21Layout.createSequentialGroup()
                .addComponent(jRadioButton14)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 35, Short.MAX_VALUE)
                .addComponent(jRadioButton15)
                .addGap(18, 18, 18))
        );
        jPanel21Layout.setVerticalGroup(
            jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel21Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(jPanel21Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButton14)
                    .addComponent(jRadioButton15)))
        );

        buttonGroup6.add(jRadioButton16);
        jRadioButton16.setText("Writeable and readable from any state");

        buttonGroup6.add(jRadioButton17);
        jRadioButton17.setText("Permanently readable and writeable");

        buttonGroup6.add(jRadioButton18);
        jRadioButton18.setText("Readable and writeable from the secured state");

        buttonGroup6.add(jRadioButton19);
        jRadioButton19.setText("Never readable and writeable");

        javax.swing.GroupLayout jPanel20Layout = new javax.swing.GroupLayout(jPanel20);
        jPanel20.setLayout(jPanel20Layout);
        jPanel20Layout.setHorizontalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jRadioButton18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addGroup(jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButton16)
                    .addComponent(jRadioButton17)
                    .addComponent(jRadioButton19))
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel20Layout.setVerticalGroup(
            jPanel20Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel20Layout.createSequentialGroup()
                .addComponent(jPanel21, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jRadioButton16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton17)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton18, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton19)
                .addGap(34, 34, 34))
        );

        jPanel22.setBorder(javax.swing.BorderFactory.createTitledBorder("Lock of EPC TID and User Bank"));

        buttonGroup7.add(jRadioButton20);
        jRadioButton20.setText("Lock of EPC TID and User Bank");

        buttonGroup7.add(jRadioButton21);
        jRadioButton21.setText("Permanently writeable");

        buttonGroup7.add(jRadioButton22);
        jRadioButton22.setText("Writeable from the secured state");

        buttonGroup7.add(jRadioButton23);
        jRadioButton23.setText("Never writeable");

        javax.swing.GroupLayout jPanel22Layout = new javax.swing.GroupLayout(jPanel22);
        jPanel22.setLayout(jPanel22Layout);
        jPanel22Layout.setHorizontalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addGroup(jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioButton20)
                    .addComponent(jRadioButton21)
                    .addComponent(jRadioButton22)
                    .addComponent(jRadioButton23))
                .addGap(0, 5, Short.MAX_VALUE))
        );
        jPanel22Layout.setVerticalGroup(
            jPanel22Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel22Layout.createSequentialGroup()
                .addComponent(jRadioButton20)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton21)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton22)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton23))
        );

        jLabel17.setText("Access Password(8HEX):");

        jButton8.setText("Set Protect");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jPanel18, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel19, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26))
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addComponent(jPanel20, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel22, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addGap(18, 18, 18)
                        .addComponent(jTextField16))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel14Layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addComponent(jButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jPanel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel18, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE))
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(jPanel22, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel17)
                            .addComponent(jTextField16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jButton8)
                        .addGap(0, 0, Short.MAX_VALUE))))
        );

        jPanel15.setBorder(javax.swing.BorderFactory.createTitledBorder("Lock Block for User"));

        jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jLabel14.setText("Address of Tag Data(WORD):");

        jLabel15.setText("Access Password (8HEX):");

        jButton5.setText("Set Protect");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel15Layout = new javax.swing.GroupLayout(jPanel15);
        jPanel15.setLayout(jPanel15Layout);
        jPanel15Layout.setHorizontalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox4, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jButton5)
                            .addComponent(jLabel15))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel15Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextField13)
                            .addComponent(jTextField14))))
                .addContainerGap())
        );
        jPanel15Layout.setVerticalGroup(
            jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel15Layout.createSequentialGroup()
                .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel14)
                    .addComponent(jTextField13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel15Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jTextField14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jButton5))
        );

        jPanel16.setBorder(javax.swing.BorderFactory.createTitledBorder("Alarm"));

        jComboBox5.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        jPanel17.setBorder(javax.swing.BorderFactory.createTitledBorder("Eas State"));

        jRadioButton8.setText("No Alarm");

        jRadioButton9.setText("Alarm");

        javax.swing.GroupLayout jPanel17Layout = new javax.swing.GroupLayout(jPanel17);
        jPanel17.setLayout(jPanel17Layout);
        jPanel17Layout.setHorizontalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jRadioButton8, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jRadioButton9))
                .addContainerGap(7, Short.MAX_VALUE))
        );
        jPanel17Layout.setVerticalGroup(
            jPanel17Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel17Layout.createSequentialGroup()
                .addComponent(jRadioButton8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButton9))
        );

        jLabel16.setText("Access Password(8HEX):");

        jButton6.setText("Set Alarm");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        jToggleButton3.setText("EasAlarm");
        jToggleButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton3ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jComboBox5, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton6))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel16Layout.createSequentialGroup()
                                .addGap(0, 0, Short.MAX_VALUE)
                                .addComponent(jLabel16))
                            .addGroup(jPanel16Layout.createSequentialGroup()
                                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, 132, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jToggleButton3)
                                    .addComponent(jLabel19, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGap(0, 0, Short.MAX_VALUE)))))
                .addContainerGap())
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel16Layout.createSequentialGroup()
                .addComponent(jComboBox5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel16Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(2, 2, 2)
                        .addComponent(jTextField15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jPanel17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton6)
                    .addComponent(jToggleButton3)))
        );

        jPanel23.setBorder(javax.swing.BorderFactory.createTitledBorder("Read Protect"));

        jPanel24.setBorder(javax.swing.BorderFactory.createTitledBorder("Select a Tag"));

        jComboBox7.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));

        javax.swing.GroupLayout jPanel24Layout = new javax.swing.GroupLayout(jPanel24);
        jPanel24.setLayout(jPanel24Layout);
        jPanel24Layout.setHorizontalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel24Layout.createSequentialGroup()
                .addComponent(jComboBox7, 0, 281, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel24Layout.setVerticalGroup(
            jPanel24Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jComboBox7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jLabel18.setText("Access Password(8HEX):");

        jButton9.setText("Lock Read");
        jButton9.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton9ActionPerformed(evt);
            }
        });

        jButton10.setText("Unlock Read");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel23Layout = new javax.swing.GroupLayout(jPanel23);
        jPanel23.setLayout(jPanel23Layout);
        jPanel23Layout.setHorizontalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addComponent(jPanel24, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel18)
                .addGap(18, 18, 18)
                .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jButton9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(18, 18, 18)
                .addComponent(jButton10)
                .addGap(35, 35, 35))
        );
        jPanel23Layout.setVerticalGroup(
            jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel24, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel23Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel23Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(jTextField17, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton9)
                    .addComponent(jButton10))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel_ISO18000_6CLayout = new javax.swing.GroupLayout(jPanel_ISO18000_6C);
        jPanel_ISO18000_6C.setLayout(jPanel_ISO18000_6CLayout);
        jPanel_ISO18000_6CLayout.setHorizontalGroup(
            jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addComponent(jPanel23, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(61, Short.MAX_VALUE))
        );
        jPanel_ISO18000_6CLayout.setVerticalGroup(
            jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE)))
                .addGroup(jPanel_ISO18000_6CLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addComponent(jPanel15, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel_ISO18000_6CLayout.createSequentialGroup()
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanel14, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel23, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        jTabbedPane.addTab("EPCC1G2 Test", jPanel_ISO18000_6C);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 933, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 13, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane, javax.swing.GroupLayout.PREFERRED_SIZE, 899, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

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

    private void jTabbedPaneStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jTabbedPaneStateChanged

        //if (jTabbedPane.getSelectedComponent() == jPanel_download) {
        //}
    }//GEN-LAST:event_jTabbedPaneStateChanged

    private void jButton_disconnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_disconnectActionPerformed
//断开按钮
         byte bMode = 0;
        switch(ConnectMode)
        {
        case 0://网口,usb
            bMode = 0;
            res = ReaderAPI.SetReaderMode(hScanner[0], bMode);//设置手机进入读写器模式，即模块电源打开，1--打开，0--关闭
                break;
        case 1://RS232
            bMode = 0;
            res = ReaderAPI.SetReaderMode(hScanner[0], bMode);//设置手机进入读写器模式，即模块电源打开，1--打开，0--关闭
                break;

        }
        if (res!=ReaderAPI._OK)
        {
                //MessageBox("SetAntenna Fail!Please try again!","Warning",MB_ICONWARNING);
                JOptionPane.showMessageDialog(this, "Set Mode Reader Fail!Please try again!", "Warning", JOptionPane.ERROR_MESSAGE);
                //return;
        }
            
        switch(ConnectMode)
	{
	case 0://usb
		//ReaderAPI.Net_DisconnectScanner();
                ReaderAPI.VH_DisconnectScannerUsb(hScanner[0]);
		break;
	case 1://rs232
                ReaderAPI.DisconnectScanner(hScanner[0]);
		break;

	}
	ifConnectReader=0;
	NewConnect=0;

	hScanner[0]	=	0;

        // 连接按钮和断开按钮
	jButton_connect.setEnabled(true);
        jButton_disconnect.setEnabled(false);


   }//GEN-LAST:event_jButton_disconnectActionPerformed

    private void jButton_connectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton_connectActionPerformed
		// 连接按钮点击事件
        connectButtonFunc();
   }//GEN-LAST:event_jButton_connectActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        // TODO add your handling code here:
        //Combox串口号
        try{
        
            //加载DLL文件，执行dll方法     
        ReaderAPI = (READERDLLAPI.READERDLL) Native.loadLibrary("VHLib", READERDLLAPI.READERDLL.class);   
        if (ReaderAPI != null)
        {   
            String strLog;
            System.out.println("DllComm加载成功！");  
            SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");//设置日期格式
            strLog = df.format(new Date()) + ".log";
            System.out.println(strLog);// new Date()为获取当前系统时间

            LogFileName = System.getProperty("user.dir");
            LogFileName += "\\Log\\"+strLog;
            System.out.println(LogFileName);//user.dir指定了当前的路径
            ReaderAPI.VH_SetLogFile(LogFileName);


        }
        else
        {
            return;
        }
        
                jComboBox_ports.removeAllItems();
                int k = 0;
                int i = 0;
                for (i = 0; i < 22; i++){
                    k = i+1;
                    jComboBox_ports.addItem("COM" + k);
                }
                jComboBox_ports.setSelectedIndex(0);
                jComboBox_ports.setEditable(false);


                InetAddress iInet = InetAddress.getLocalHost();
                jTextField3.setText(iInet.getHostAddress().toString());//主机IP

                Random random = new Random();
                m_HostPort  =   1024+Math.abs(random.nextInt())%60000;
                jTextField4.setText(String.valueOf(m_HostPort));//主机端口
                jRadioButton1ActionPerformed(null);

                
                jTextField1.setEnabled(false);
                jTextField2.setEnabled(false);
                jTextField3.setEnabled(false);
                jTextField4.setEnabled(false);
                
                //====================参数界面============================================
                jTextField18.setText("");//ID
                
                //ISO18000-6B,6C
                buttonGroup8.add (jRadioButton24);
                buttonGroup8.add (jRadioButton25);
                
                //Save and Output, Save, Output
                buttonGroup9.add (jRadioButton26);
                buttonGroup9.add (jRadioButton27);
                buttonGroup9.add (jRadioButton28);
                
                //TID,Start,Length
                jTextField19.setText("");
                jTextField19.setText("");
                
                //User Start,Length
                jTextField21.setText("");
                jTextField22.setText("");
                        
                //SetTime
                jTextField23.setText("");
                
                //mask,Start Address, Length, Mask(HEX)
                jTextField24.setText("");
                jTextField25.setText("");
                jTextField26.setText("");
                
                jComboBox8.removeAllItems();
                jComboBox8.addItem("9600");
                jComboBox8.addItem("19200");
                jComboBox8.addItem("38400");
                jComboBox8.addItem("57600");
                jComboBox8.addItem("115200");
                jComboBox8.setSelectedIndex(0);
                jComboBox8.setEditable(false);
                
                //RF Hardware Ver
                jTextField27.setText("");
                //RF Software Ver
                jTextField28.setText("");
                //RF Power Output
                jTextField29.setText("");
                jTextField30.setEditable(false);
                
                //===========================BLUETOOTH====================================
                jComboBox11.removeAllItems();
                jComboBox11.addItem("9600");
                jComboBox11.addItem("19200");
                jComboBox11.addItem("38400");
                jComboBox11.addItem("57600");
                jComboBox11.addItem("115200");
                jComboBox11.setSelectedIndex(0);
                jComboBox11.setEditable(false);


                //=====================ISO18000-6C界面====================================
                //Read Interval,10ms 20ms 30ms 50ms 100ms 200ms 500ms
                int [] interval = new int[]{10,20,30,50,100,200,500};
                jComboBox1.removeAllItems();
                for (i = 0; i < interval.length; i++){

                    jComboBox1.addItem(interval[i]+"ms");
                }
                jComboBox1.setSelectedIndex(interval.length-2);
                jComboBox1.setEditable(false);


                //ANT
                jCheckBox1.setSelected(true);//选中

                //列标签的EPC要选中
                jRadioButton3.setSelected(true);//选中

                //设置列表列宽
                TableColumn firsetColumn = jTable1.getColumnModel().getColumn(0);
                firsetColumn.setPreferredWidth(30);
                firsetColumn.setMaxWidth(30);
                firsetColumn.setMinWidth(30);

                TableColumn fimsetColumn = jTable1.getColumnModel().getColumn(1);
                fimsetColumn.setPreferredWidth(300);
                fimsetColumn.setMaxWidth(300);
                fimsetColumn.setMinWidth(300);


                //Read and Write Data Block, 块的读写，四个区选择
                buttonGroup2.add (jRadioButton4);
                buttonGroup2.add (jRadioButton5);
                buttonGroup2.add (jRadioButton6);
                buttonGroup2.add (jRadioButton7);
                jRadioButton5.setSelected(true);
                jTextField9.setText("0");
                jTextField10.setText("1");
                jTextField11.setText("00000000");
                jScrollPane2.setVisible(false);
                hlistModel = new DefaultListModel();


                //Set protect for reading or writing 读写保护,四区选择
                buttonGroup3.add (jRadioButton10);
                buttonGroup3.add (jRadioButton11);
                buttonGroup3.add (jRadioButton12);
                buttonGroup3.add (jRadioButton13);
                jRadioButton11.setSelected(true);

                //Kill password ,Access password
                buttonGroup4.add (jRadioButton14);
                buttonGroup4.add (jRadioButton15);
                jRadioButton15.setSelected(true);//Access password select

                //密码锁住几个类型
                buttonGroup5.add (jRadioButton16);
                buttonGroup5.add (jRadioButton17);
                buttonGroup5.add (jRadioButton18);
                buttonGroup5.add (jRadioButton19);
                jRadioButton16.setSelected(true);//

                //Lock of EPC TID and User Bank, 锁EPC和其它区
                buttonGroup6.add (jRadioButton20);
                buttonGroup6.add (jRadioButton21);
                buttonGroup6.add (jRadioButton22);
                buttonGroup6.add (jRadioButton23);
                jRadioButton20.setSelected(true);//

                //EAS
                buttonGroup7.add (jRadioButton8);
                buttonGroup7.add (jRadioButton9);
                jRadioButton8.setSelected(true);//


                //kill tag
                jComboBox2.removeAllItems();
                jComboBox2.setEditable(false);


                //块的读写
                jComboBox3.removeAllItems();
                jComboBox3.setEditable(false);


                //Set protect for reading or writing
                jComboBox6.removeAllItems();
                jComboBox6.setEditable(false);

                //Lock Block for User
                jComboBox4.removeAllItems();
                jComboBox4.setEditable(false);

                //Alarm
                jComboBox5.removeAllItems();
                jComboBox5.setEditable(false);

                //Read Protect
                jComboBox7.removeAllItems();
                jComboBox7.setEditable(false);

                //下载页面
                //SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
                SimpleDateFormat df = new SimpleDateFormat("yyyy-MM");//设置日期格式
                //String strD = df.format(new Date());
                String strD = df.format(new Date()) + "-01" + " 00:00:00";
                jTextField33.setText(strD);
                
                SimpleDateFormat dm = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式
                strD = dm.format(new Date()) + " 23:59:59";
                jTextField34.setText(strD);
                
                //设置列表列宽
                TableColumn firsetColumn2 = jTable2.getColumnModel().getColumn(0);
                firsetColumn2.setPreferredWidth(30);
                firsetColumn2.setMaxWidth(30);
                firsetColumn2.setMinWidth(30);

                TableColumn fimsetColumn3 = jTable2.getColumnModel().getColumn(1);
                fimsetColumn3.setPreferredWidth(300);
                fimsetColumn3.setMaxWidth(300);
                fimsetColumn3.setMinWidth(300);
                
                
                
                //设置列表列宽
                TableColumn firsetColumn4 = jTable3.getColumnModel().getColumn(0);
                firsetColumn4.setPreferredWidth(80);
                firsetColumn4.setMaxWidth(80);
                firsetColumn4.setMinWidth(80);

                TableColumn fimsetColumn5 = jTable3.getColumnModel().getColumn(1);
                fimsetColumn5.setPreferredWidth(300);
                fimsetColumn5.setMaxWidth(300);
                fimsetColumn5.setMinWidth(300);
                
                ((DefaultTableModel) jTable3.getModel()).getDataVector().clear();   //清除表格数据
                ((DefaultTableModel) jTable3.getModel()).fireTableDataChanged();//通知模型更新
                jTable3.updateUI();//刷新表格
                
                jTextField35.setText("12345678");
                
                //最后一页自动输出
                //jPanel_AutoTest.setVisible(false);
                //jTableAuto.setVisible(false);
                
                //更新外购状态
                UpdateStatus();
                //========================================================================


                running = false;
                //startRun();




                System.out.println("formWindowOpened!\n");
        } catch (Exception e) {
                    e.printStackTrace();
                    System.out.println("Exception of formWindowOpened:\n");

        }

    }//GEN-LAST:event_formWindowOpened

    private void UpdateStatus(){
        if ( ifConnectReader ==	0) { //读写器是否连接，1---连接,0---没有连接
            jCheckBox1.setEnabled(false);
            jCheckBox2.setEnabled(false);
            jCheckBox3.setEnabled(false);
            jCheckBox4.setEnabled(false);

            jComboBox1.setEnabled(false);

            jRadioButton3.setEnabled(false);

            jTextField5.setEnabled(false);
            jTextField6.setEnabled(false);
            jTextField7.setEnabled(false);
            //jButton1.setEnabled(false);//list tag
            jToggleButton1.setEnabled(false);


            jComboBox2.setEnabled(false);
            jTextField8.setEnabled(false);
            jButton2.setEnabled(false);//kill tag


            //block read and write
            jComboBox3.setEnabled(false);
            jRadioButton4.setEnabled(false);
            jRadioButton5.setEnabled(false);
            jRadioButton6.setEnabled(false);
            jRadioButton7.setEnabled(false);
            jTextField9.setEnabled(false);
            jTextField10.setEnabled(false);
            jTextField11.setEnabled(false);
            jTextField12.setEnabled(false);
            //jButton3.setEnabled(false);//Read
            jToggleButton2.setEnabled(false);
            jButton4.setEnabled(false);//Write




            //Set protect for reading or writing
            jRadioButton10.setEnabled(false);
            jRadioButton11.setEnabled(false);
            jRadioButton12.setEnabled(false);
            jRadioButton13.setEnabled(false);

            jRadioButton14.setEnabled(false);
            jRadioButton15.setEnabled(false);

            jRadioButton16.setEnabled(false);
            jRadioButton17.setEnabled(false);
            jRadioButton18.setEnabled(false);
            jRadioButton19.setEnabled(false);

            jComboBox6.setEnabled(false);
            jRadioButton20.setEnabled(false);
            jRadioButton21.setEnabled(false);
            jRadioButton22.setEnabled(false);
            jRadioButton23.setEnabled(false);

            //jTextField16.setEnabled(false);
            jButton8.setEnabled(false);//set Protect



            //Lock Block for User
            jComboBox4.setEnabled(false);
            jTextField13.setEnabled(false);
            jTextField14.setEnabled(false);
            jButton5.setEnabled(false);//set Protect



            //Alarm
            jComboBox5.setEnabled(false);
            jRadioButton8.setEnabled(false);
            jRadioButton9.setEnabled(false);
            jTextField15.setEnabled(false);
            jButton6.setEnabled(false);//set Alarm
            //jButton7.setEnabled(false);//EasAlarm
            jToggleButton3.setEnabled(false);



            //Read Protect
            jComboBox7.setEnabled(false);
            jTextField17.setEnabled(false);
            jButton9.setEnabled(false);//Lock Read
            jButton10.setEnabled(false);//Unlock Read


        }else {
            //1---连接
            jCheckBox1.setEnabled(true);
            jCheckBox2.setEnabled(true);
            jCheckBox3.setEnabled(true);
            jCheckBox4.setEnabled(true);

            jComboBox1.setEnabled(true);

            jRadioButton3.setEnabled(true);

            jTextField5.setEnabled(true);
            jTextField6.setEnabled(true);
            jTextField7.setEnabled(true);
            //jButton1.setEnabled(true);//list tag
            jToggleButton1.setEnabled(true);


            jComboBox2.setEnabled(true);
            jTextField8.setEnabled(true);
            jButton2.setEnabled(true);//kill tag



            //block read and write
            jComboBox3.setEnabled(true);
            jRadioButton4.setEnabled(true);
            jRadioButton5.setEnabled(true);
            jRadioButton6.setEnabled(true);
            jRadioButton7.setEnabled(true);
            jTextField9.setEnabled(true);
            jTextField10.setEnabled(true);
            jTextField11.setEnabled(true);
            jTextField12.setEnabled(true);
            //jButton3.setEnabled(true);//Read
            jToggleButton2.setEnabled(true);
            jButton4.setEnabled(true);//Write




            //Set protect for reading or writing
            jRadioButton10.setEnabled(true);
            jRadioButton11.setEnabled(true);
            jRadioButton12.setEnabled(true);
            jRadioButton13.setEnabled(true);

            jRadioButton14.setEnabled(true);
            jRadioButton15.setEnabled(true);

            jRadioButton16.setEnabled(true);
            jRadioButton17.setEnabled(true);
            jRadioButton18.setEnabled(true);
            jRadioButton19.setEnabled(true);

            jComboBox6.setEnabled(true);
            jRadioButton20.setEnabled(true);
            jRadioButton21.setEnabled(true);
            jRadioButton22.setEnabled(true);
            jRadioButton23.setEnabled(true);

            jTextField16.setEditable(true);
            jButton8.setEnabled(true);//set Protect



            //Lock Block for User
            jComboBox4.setEnabled(true);
            jTextField13.setEnabled(true);
            jTextField14.setEnabled(true);
            jButton5.setEnabled(true);//set Protect



            //Alarm
            jComboBox5.setEnabled(true);
            jRadioButton8.setEnabled(true);
            jRadioButton9.setEnabled(true);
            jTextField15.setEnabled(true);
            jButton6.setEnabled(true);//set Alarm
            //jButton7.setEnabled(true);//EasAlarm
            jToggleButton3.setEnabled(true);



            //Read Protect
            jComboBox7.setEnabled(true);
            jTextField17.setEnabled(true);
            jButton9.setEnabled(true);//Lock Read
            jButton10.setEnabled(true);//Unlock Read




        }
    }

    protected  static void startRun(){
        Timer timer = new Timer();
        TimerTask task =new TimerTask(){
            @Override
             public void run(){
                if (running){
                 System.out.println("开始运行"); //在这写你要调用的方法

                }
                else{
                    //this.cancel();
                    //System.exit(0);
                }

             }
         };
        timer.scheduleAtFixedRate(task, new Date(),timer_interval);//当前时间开始起动 每次间隔2秒再启动
        // timer.scheduleAtFixedRate(task, 1000,2000); // 1秒后启动  每次间隔2秒再启动
     }

    // Mytimer class
class MyTimer extends Thread
{
    private boolean endtime=false;
    private boolean run=false;
    private int iInterval   =   1000;

    private byte[] ReaderID = new byte[10];
    @Override
    public void run()
    {
        DefaultListModel listModel=null;
        listModel = new DefaultListModel();
        for(;;)
        {

            //System.out.println("ThreadRun!"); //在这写你要调用的方法

            try{
            int res = -1;
            int be_antenna	=	0;
            int i,j,k,ID_len=0,ID_len_temp=0;
            String str = "",str_temp;
            String strTemp;
            byte[] temp = new byte[64*2];
            byte[] DB = new byte[128];
            byte[] IDBuffer = new byte[30*256];
            int[] nCounter = new int[2];

            boolean bFlag = false;
            //////////////////////////////////////////////////////////////////////////
            //add by mqs 20130710 新方法
            int itmpAnt	=	0;

            itmpAnt	=	Read_times % iModAnt;

            itmpAnt = gAntenna[itmpAnt];

            Read_times++;

            
            //////////////////////////////////////////////////////////////////////////
            switch(nIDEvent){
                case 1://list to tag
                    switch(ConnectMode)
                    {
                    case 0://U口
                        res=ReaderAPI.EPC1G2_ReadLabelID(hScanner[0], mem, ptr, len, mask, IDBuffer, nCounter, Address);
                            break;
                    case 1://RS232
                        res=ReaderAPI.EPC1G2_ReadLabelID(hScanner[0], mem, ptr, len, mask, IDBuffer, nCounter, Address);
                            break;

                    }
                    k=jTable1.getRowCount();
                    //if (res==ReaderAPI._OK)
                    {
                        //这句是为了测试用
                        if ( nCounter[0] > 8 ){
                            i = nCounter[0];
                        }

                        for(i=0;i<nCounter[0];i++){
                            if (IDBuffer[ID_len]>32)
                            {
                                    nCounter[0]=0;
                                    break;
                            }
                            ID_len_temp=IDBuffer[ID_len]*2+1;//1word=16bit
                            //memcpy(EPCC1G2_IDBuffer[i], &IDBuffer[ID_len], ID_len_temp);
                            System.arraycopy(IDBuffer, ID_len, EPCC1G2_IDBuffer[i], 0, ID_len_temp);
                            ID_len+=ID_len_temp;
                        }

                        //锋鸣器响一下，看java如何实现，现在没时间查
                        if (nCounter[0]>0){
                            //MessageBeep(-1);
                        }


                        for(i=0;i<nCounter[0];i++){

                            str="";
                            ID_len=EPCC1G2_IDBuffer[i][0]*2;
                            System.arraycopy(EPCC1G2_IDBuffer[i], 1, temp, 0, ID_len);

                            //将字节转16进制字符串 0x31 0x32 ===> "3132"
                            str = Utility.bytes2HexString(temp, ID_len);




                            //查有没有相同的EPC
                            for(j=0;j<k;j++)
                            {
                                //取第i行第4列
                                strTemp = (String) jTable1.getValueAt(j, 4);
                                ID_len_temp = (int)Integer.parseInt(strTemp, 16);
                                ID_len_temp *= 2;

                                if (ID_len == ID_len_temp){

                                    //取第i行第i列
                                    strTemp = (String) jTable1.getValueAt(j, 1);
                                    str_temp=strTemp;
                                    if(str.equals(str_temp))
                                    {
                                            //i = 0;
                                            break;
                                    }
                                }
                            }


                            //LinkedList<String> result = new LinkedList<String>();
                            DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
                            //新加一行数据到表格中
                            if(j == k){
                                //序号
                                String strID = String.format("%d", k+1);//0
                                String strEPC = str;                    //1
                                String strSuccess = "1";                //2
                                String strTimes = "1";                  //3
                                String strLLen = String.format("%02X", EPCC1G2_IDBuffer[i][0]);//4


                                model.addRow(new Object[]{
                                strID,          //0
                                strEPC,         //1
                                strSuccess,     //2
                                strTimes,       //3
                                strLLen         //4
                                });
                                k++;


                            }
                            else
                            {
                                //先取出当前行
                                strTemp = (String) jTable1.getValueAt(j, 2);
                                i = Integer.parseInt(strTemp);
                                strTemp = String.valueOf(i+1);

                                //再更新
                                jTable1.setValueAt(strTemp, j, 2);

                            }

                        }

                    }
                    for(i=0;i<k;i++){
                            //m_ListID.SetItemText(i,3,itoa(Read_times,temp,10));
                        DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
                        strTemp = String.valueOf(Read_times);
                        jTable1.setValueAt(strTemp, i, 3);
                    }

                    break;

                case 2://块读
                    switch(ConnectMode)
                    {
                        case 0://网口,usb
                            res=ReaderAPI.EPC1G2_ReadWordBlock(hScanner[0],EPC_Word,IDTemp,mem,ptr,len,DB,AccessPassword, Address);
                            break;
                        case 1://RS232
                            res=ReaderAPI.EPC1G2_ReadWordBlock(hScanner[0],EPC_Word,IDTemp,mem,ptr,len,DB,AccessPassword, Address);
                            break;
                    }
                    if (res==ReaderAPI._OK)
                    {
			str="";
			for(i=0;i<len*2;i++)
			{
				strTemp = String.format("%02X",DB[i]);
				str    += strTemp;
			}



			//m_ListData.AddString(str);
			//m_ListData.SetCurSel(m_ListData.GetCount()-1);
                    }
                    else
                    {
                        str="Read Fail!";
                        //m_ListData.AddString(str);
                    }
                    //当JList的项集合为空时
                    //if(0 == jList1.getModel().getSize())
                    {
                        //新建一个默认项集合

                        //操作这个集合
                        listModel.add(listModel.getSize(), str);
                        //将这个集合添加到JList中
                        jList1.setModel(listModel);
                        //jList1.setSelectedValue(nIDEvent, bFlag);

                        jList1.setSelectedIndex(listModel.getSize()-1);
                        //int iListS=jList1.getSelectedIndex();
                        //Rectangle rect=jList1.getCellBounds(iListS, iListS);
                        //jList1.scrollRectToVisible(rect);
                    }
                    //JList的项不为空时
                    //else
                    //{
                        //从JList中获得这个集合,转换为默认项集合类型
                    //    DefaultListModel listModel= (DefaultListModel) jList1.getModel();
                        //追加元素
                    //    listModel.add(listModel.getSize(), str);
                        //将这个集合添加到JList中
                    //    jList1.setModel(listModel);
                    //}




                    break;

                case 3:
                    switch(ConnectMode)
                    {
                    case 0://网口,usb
                        res=ReaderAPI.EPC1G2_EasAlarm(hScanner[0], Address);
                            break;
                    case 1://RS232
                        res=ReaderAPI.EPC1G2_EasAlarm(hScanner[0], Address);
                            break;


                    }
                    
                    String name="icon1.JPG";
                    ImageIcon icon=new ImageIcon(name);  
                        
                    if(res==ReaderAPI._OK)
                    {
                            //MessageBeep(-1);
                            //new ShowImage("").setVisible(true);
                        
                        //这个是强制缩放到与组件(Label)大小相同   
                        //icon=new ImageIcon(icon.getImage().getScaledInstance(getWidth(), getHeight()-25, Image.SCALE_DEFAULT));  
                        //这个是按等比缩放   
                        //              icon=new ImageIcon(icon.getImage().getScaledInstance(reImgWidth, reImgHeight, Image.SCALE_DEFAULT));   
                        jLabel19.setIcon(icon);  
                        jLabel19.setHorizontalAlignment(SwingConstants.CENTER);  

                        
                    }

                    Thread.sleep(500);
                    
                    name="icon2.JPG";
                    icon=new ImageIcon(name);  
                    //这个是强制缩放到与组件(Label)大小相同   
                    //icon=new ImageIcon(icon.getImage().getScaledInstance(getWidth(), getHeight()-25, Image.SCALE_DEFAULT));  
                    //这个是按等比缩放   
                    //              icon=new ImageIcon(icon.getImage().getScaledInstance(reImgWidth, reImgHeight, Image.SCALE_DEFAULT));   
                    jLabel19.setIcon(icon);  
                    jLabel19.setHorizontalAlignment(SwingConstants.CENTER);


                    break;

                case 4:
                    break;
            }



            ///

            if (endtime){
                run = false;
                break;
            }



            //only sleep 1s per.

                Thread.sleep(iInterval);
            }
            catch (InterruptedException ex)
            {
                System.out.println(ex);
            }

            run = true;

        }
    }
    public void setEnd(boolean t)
    {
        endtime=t;
    }
    public void setInterval(int time)
    {
        iInterval=time;
    }
    public boolean getRun()
    {
        return run;
    }

    private void ShowImage(String ImgFile){
        //super("ShowImage");
        Image image =null;
        try{
            image=ImageIO.read(new File(ImgFile));
        }catch(IOException ex){
        }
        JLabel label =new JLabel(new ImageIcon(image));
        add(label);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        pack();
    }
}



class MyTimerAuto extends Thread
{
    private boolean endtime=false;

    
    @Override
    public void run()
    {
        Selector selector = null;  
        try {  
             
            
            if ( !socket.isBound() && !bound ){
                            socket.bind(new InetSocketAddress(iHostPort));//test:7777 
                            bound = true;
                        }

            selector = Selector.open();  
            channel.register(selector, SelectionKey.OP_READ);  
        } catch (Exception e) {  
            e.printStackTrace();  
        }  

        ByteBuffer byteBuffer = ByteBuffer.allocate(65536);  
        while (true) {  
            try {  
                if (endtime){
                
                break;
                }
                
                int eventsCount = selector.select(1000);  
                if (eventsCount > 0) {  
                    Set selectedKeys = selector.selectedKeys();  
                    Iterator iterator = selectedKeys.iterator();  
                    while (iterator.hasNext()) {  
                        SelectionKey sk = (SelectionKey) iterator.next();  
                        iterator.remove();  
                        if (sk.isReadable()) {  
                            DatagramChannel datagramChannel = (DatagramChannel) sk  
                                    .channel();  
                            SocketAddress sa = datagramChannel  
                                    .receive(byteBuffer);  
                            byteBuffer.flip();  

                            // 测试：通过将收到的ByteBuffer首先通过缺省的编码解码成CharBuffer 再输出   
                            CharBuffer charBuffer = Charset.defaultCharset()  
                                    .decode(byteBuffer);  
                            System.out.println("receive message:"  
                                    + charBuffer.toString());  
                            
                            iTagNumber += 1;//auto下的tag的个数

                            byteBuffer.clear();  


                        }  
                    }  
                }  
            } catch (Exception e) {  
                e.printStackTrace();  
            } 
            
            
            
            
            
            
    
    /*
        DatagramChannel channel = null;
        DatagramSocket socket = null;
                
        try{
            System.out.println("ThreadRun Start!"); //在这写你要调用的方法
        
                channel = DatagramChannel.open();
		socket = channel.socket();
                // 设置为非阻塞模式
		channel.configureBlocking(false);
                        
                // 若希望是全双工模式，则启动一个监听端口，承担服务器的职责
			// 若不能绑定到指定端口，则抛出SocketException
			
			InetAddress InHostaddress = InetAddress.getLocalHost();
			SocketAddress saHost = new InetSocketAddress(InHostaddress,
					7777);
                    if ( !socket.isBound()  ){
                            socket.bind(saHost);
                            //bound = true;
                        }
                    
        }catch(IOException ex){
                System.out.println("Run Error!");
            }
                    
        for(;;)
        {

            if (endtime){
                
                break;
            }

            try{
            
                //System.out.println("ThreadRun!"); //在这写你要调用的方法
                    
                int iRecvLen = 0;
                ByteBuffer byteBuffer = ByteBuffer.allocate(65535);
                byteBuffer.clear();
                SocketAddress sb = channel.receive(byteBuffer);
                
                byteBuffer.flip();
                iRecvLen = byteBuffer.limit();
                System.out.println("\niRecvLen="+iRecvLen);
                
                    
            }catch(IOException ex){
                
            }
         */   
        }


        //try {  
        //    channel.close();
        //    socket.close();
        //} catch (Exception e) {  
        //    e.printStackTrace();  
        //}  

    }
    
    
    public void setEnd(boolean t)
    {
        endtime=t;
    }
    
 }
    

class MyTimerSerialAuto extends Thread
{
    private boolean endtime=false;

    
    @Override
    public void run()
    {
        
        int iChar = 0;
        while (true) {  
            try {  
                if (endtime){
                
                break;
                }
                
                //iChar = ReaderAPI.GetSerialData();
                if ( 0 != iChar ){
                    //jLabelAutoTestTagNumValue.setText(""+iTagNumber);
                    // 测试：通过将收到的ByteBuffer首先通过缺省的编码解码成CharBuffer 再输出   
                            //CharBuffer charBuffer = Charset.defaultCharset()  
                            //        .decode() 
                            //System.out.println("receive message:"  
                            //        + charBuffer.toString());  
                    
                    byte[] bytes = new byte[1];
                    bytes[0] = (byte)iChar;
                    if ( 0 == iChar ){
                        
                    }
                    else
                    {
                        if ( 0x0A == iChar ){
                            iTagNumber += 1;//auto下的tag的个数
                            
                        }
                        
                        String isoString = new String(bytes, "ISO-8859-1");

                        
                        
                    }
                    
                }
                        
            } catch (Exception e) {  
                e.printStackTrace();  
            } 
            
        }
    }
    
    
    public void setEnd(boolean t)
    {
        endtime=t;
    }
    
 }

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        // TODO add your handling code here:
//块写
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank

        //清空list

        //0---密码， 1---EPC， 2---TID， 3---USER
        //查长度
        strTemp = jTextField10.getText();
        m_LLen = Integer.parseInt(strTemp);
        if ((m_LLen<1) || (m_LLen>2048))
	{
            //MessageBox("Please input Length of Tag Data more than 1!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 0 and 2048!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField10.grabFocus();
            jToggleButton2.setSelected(false);
            return;
	}

        mem=m_mem;
        switch(mem)
	{
	case 0x00:
            if ((m_LLen<1) || (m_LLen>4)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 4 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x02:
            if ((m_LLen<1) || (m_LLen>64)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 8 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x01:
            if ((m_LLen<1) || (m_LLen>32)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 32 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x03:
            if ((m_LLen<1) || (m_LLen>128)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 128 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        }

        //0---密码， 1---EPC， 2---TID， 3---USER
        if ( jRadioButton4.isSelected() ){
            m_mem = 0;//bank
        }
        if ( jRadioButton5.isSelected() ){
            m_mem = 1;//bank
        }
        if ( jRadioButton6.isSelected() ){
            m_mem = 2;//bank
        }
        if ( jRadioButton7.isSelected() ){
            m_mem = 3;//bank
        }



        //访问密码
        //判断是不是16字串
        strTemp = jTextField11.getText();
        if ( !Utility.isHexString(strTemp) && !strTemp.isEmpty() ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField7.grabFocus();
            jToggleButton1.setSelected(false);
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);

        //要写的内容
        //判断是不是16字串
        strTemp = jTextField12.getText();
        if ( !Utility.isHexString(strTemp) && !strTemp.isEmpty() ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField7.grabFocus();
            jToggleButton1.setSelected(false);
            return;
        }

        if ( strTemp.length() == 0 || strTemp.length()/4 < m_LLen  ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of Tag Data!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }
        mask = Utility.convert2HexArray(strTemp);

        //m_mem 指0---密码，1---EPC，2---TID, 3---USER
	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox3.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}


            int i = 0;
            int k = 0;
            byte[] bTmpAnt = new byte[4];
            m_antenna_sel=0;
            bTmpAnt[0] = 0;
            bTmpAnt[1] = 0;
            bTmpAnt[2] = 0;
            bTmpAnt[3] = 0;
            gAntenna[0] = 0;
            gAntenna[1] = 0;
            gAntenna[2] = 0;
            gAntenna[3] = 0;
            iModAnt	=	0;
            if(jCheckBox1.isSelected())
            {
                    bTmpAnt[0] = 1;
                    iModAnt++;
                    m_antenna_sel += 1;
            }

            if(jCheckBox2.isSelected())
            {
                    bTmpAnt[1] = 2;
                    iModAnt++;
                    m_antenna_sel += 2;
            }

            if(jCheckBox3.isSelected())
            {
                    bTmpAnt[2] = 4;
                    iModAnt++;
                    m_antenna_sel += 4;
            }

            if(jCheckBox4.isSelected())
            {
                    bTmpAnt[3] = 8;
                    iModAnt++;
                    m_antenna_sel += 8;
            }

            for (i = 0; i < 4; i++)
            {
                    if ( bTmpAnt[i] != 0 )
                    {
                            gAntenna[k]	=	bTmpAnt[i];
                            k++;
                    }
            }


		

                for(i=0;i<5;i++)
		{

			switch(ConnectMode)
			{
			case 0://网口,usb
                            res=ReaderAPI.EPC1G2_WriteWordBlock(hScanner[0],EPC_Word,IDTemp,mem,ptr,len,mask,AccessPassword, Address);
				break;
			case 1://rs232
                            res=ReaderAPI.EPC1G2_WriteWordBlock(hScanner[0],EPC_Word,IDTemp,mem,ptr,len,mask,AccessPassword, Address);
                                break;
			}
			if ((res==ReaderAPI._OK))
				break;
		}
                if (res==ReaderAPI._OK)
                {
                    //m_ListData.AddString("Write Successfully!");
                    strTemp = "Write Successfully!";
                }
                else
                {
                    strTemp = "Write Error!";

                }

                //操作这个集合
                hlistModel.add(hlistModel.getSize(), strTemp);
                //将这个集合添加到JList中
                jList1.setModel(hlistModel);
                //jList1.setSelectedValue(nIDEvent, bFlag);

                jList1.setSelectedIndex(hlistModel.getSize()-1);




    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
//杀列标签 Kill tag
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank
        byte[] KillPassword = new byte[4];

        //先检查EPC是否先了
        if ( jComboBox2.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }



        //访问密码
        //判断是不是16字串
        strTemp = jTextField8.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField8.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField8.grabFocus();
            return;
        }

        //将字符串变为字节数组
        KillPassword = Utility.convert2HexArray(strTemp);



        //m_mem 指0---密码，1---EPC，2---TID, 3---USER
	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox2.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}


        Object[] options = {"OK","Cancel"};
        int response=JOptionPane.showOptionDialog(this, "Are you sure to Kill the tag?", "Warning",JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        if(response==0)
        {

        }
        else if(response==1)
        {
            //NO
            return;
        }



        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }


       



        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_KillTag(hScanner[0], EPC_Word, IDTemp, KillPassword, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_KillTag(hScanner[0], EPC_Word, IDTemp, KillPassword, Address);
                        break;
                }
                if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Kill tag successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Kill tag Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }




    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
        // TODO add your handling code here:
//USER区数据保护
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank
        

        //byte[] AccessPassword = new byte[4];

        //先检查EPC是否先了
        if ( jComboBox4.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //起地
        strTemp = jTextField13.getText();
        m_LAddress = Integer.parseInt(strTemp);
        if ((m_LAddress<0) || (m_LAddress>2047))
	{
            //MessageBox("Please input Location of Tag Address between 0 and 2047!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Location of Tag Address between 0 and 2047!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField13.grabFocus();
            return;

	}

        //访问密码
        //判断是不是16字串
        strTemp = jTextField14.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField14.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField14.grabFocus();
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);


	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox4.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}


        Object[] options = {"OK","Cancel"};
        strTemp = String.format("Are you sure to set protect address %d of User?", m_LAddress);
        int response=JOptionPane.showOptionDialog(this, strTemp, "Warning",JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        if(response==0)
        {

        }
        else if(response==1)
        {
            //NO
            return;
        }

        
        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }


        

        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_BlockLock(hScanner[0], EPC_Word, IDTemp, ptr, AccessPassword, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_BlockLock(hScanner[0], EPC_Word, IDTemp, ptr, AccessPassword, Address);
                        break;
                }
                //if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set Protect successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set Protect Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }


    }//GEN-LAST:event_jButton5ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
        // TODO add your handling code here:
//Kill密码保护，EPC,TID,USER模式保护
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;

        int m_mem = 0;//bank
        int m_Condition = 0;
        int m_Condition2 = 0;
        int m_Password = 0;
        int lock = 0;

        //byte[] AccessPassword = new byte[4];

        //先检查EPC是否先了
        if ( jComboBox6.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }



        //访问密码
        //判断是不是16字串
        strTemp = jTextField16.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField16.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField16.grabFocus();
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);


        //m_mem 指0---密码，1---EPC，2---TID, 3---USER
        //0---密码， 1---EPC， 2---TID， 3---USER
        if ( jRadioButton10.isSelected() ){
            m_mem = 0;//bank
        }
        if ( jRadioButton11.isSelected() ){
            m_mem = 1;//bank
        }
        if ( jRadioButton12.isSelected() ){
            m_mem = 2;//bank
        }
        if ( jRadioButton13.isSelected() ){
            m_mem = 3;//bank
        }
	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox6.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}


        Object[] options = {"OK","Cancel"};
        int response=JOptionPane.showOptionDialog(this, "Are you sure to protect this tag?", "Warning",JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        if(response==0)
        {

        }
        else if(response==1)
        {
            //NO
            return;
        }

        if ( jRadioButton16.isSelected() ){
            m_Condition = 0;//
        }
        if ( jRadioButton17.isSelected() ){
            m_Condition = 1;//
        }
        if ( jRadioButton18.isSelected() ){
            m_Condition = 2;//
        }
        if ( jRadioButton19.isSelected() ){
            m_Condition = 3;//
        }

        if ( jRadioButton20.isSelected() ){
            m_Condition2 = 0;//
        }
        if ( jRadioButton21.isSelected() ){
            m_Condition2 = 1;//
        }
        if ( jRadioButton22.isSelected() ){
            m_Condition2 = 2;//
        }
        if ( jRadioButton23.isSelected() ){
            m_Condition2 = 3;//
        }


        //是哪个密码，0-Kill 1-Access
        if(jRadioButton14.isSelected()){
            //kill选中
            m_Password = 0;
        }
        if(jRadioButton15.isSelected()){
            //Access选中
            m_Password = 1;
        }

        if(m_mem == 0){
            //kill选中
            mem = m_Password;
            lock=m_Condition+4;
        }
        else {
            //Access选中
            mem=m_mem+1;
            lock=m_Condition2;
        }




        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }


        



        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_SetLock(hScanner[0], EPC_Word, IDTemp, mem, lock, AccessPassword, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_SetLock(hScanner[0], EPC_Word, IDTemp, mem, lock, AccessPassword, Address);
                        break;
                }
                if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set Lock successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set Lock Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }

        
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
        // TODO add your handling code here:
//EAS 设置报警
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank
        int m_EasState = 0;
        
        //先检查EPC是否先了
        if ( jComboBox5.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //访问密码
        //判断是不是16字串
        strTemp = jTextField15.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField15.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField15.grabFocus();
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);


	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox5.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}

        
        //是哪Alarm,no Alarm
        if(jRadioButton8.isSelected()){
            //No Alarm
            m_EasState = 0;
        }
        if(jRadioButton9.isSelected()){
            //Alarm
            m_EasState = 1;
        }

        
        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }


       

        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_ChangeEas(hScanner[0], EPC_Word, IDTemp, m_EasState, AccessPassword, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_ChangeEas(hScanner[0], EPC_Word, IDTemp, m_EasState, AccessPassword, Address);
                        break;
                }
                if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set Eas Alarm successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set Eas Alarm Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }
        
        
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton9ActionPerformed
        // TODO add your handling code here:
//Read Lock 读锁定
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank
        

        //先检查EPC是否先了
        if ( jComboBox7.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //访问密码
        //判断是不是16字串
        strTemp = jTextField17.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField17.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField17.grabFocus();
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);


	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox7.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}

        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }





        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_ReadProtect(hScanner[0], AccessPassword, EPC_Word, IDTemp, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_ReadProtect(hScanner[0], AccessPassword, EPC_Word, IDTemp, Address);
                        break;
                }
                if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Read Protect successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Read Protect Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }

        
    }//GEN-LAST:event_jButton9ActionPerformed

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
        // TODO add your handling code here:
//Read Unlock 取消读锁定
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank
        

        //先检查EPC是否先了
        if ( jComboBox7.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //访问密码
        //判断是不是16字串
        strTemp = jTextField17.getText();
        if ( !Utility.isHexString(strTemp)  ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField17.grabFocus();
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField17.grabFocus();
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);


	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;


        int CurSel=jComboBox7.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}

        int i = 0;
        int k = 0;
        byte[] bTmpAnt = new byte[4];
        m_antenna_sel=0;
        bTmpAnt[0] = 0;
        bTmpAnt[1] = 0;
        bTmpAnt[2] = 0;
        bTmpAnt[3] = 0;
        gAntenna[0] = 0;
        gAntenna[1] = 0;
        gAntenna[2] = 0;
        gAntenna[3] = 0;
        iModAnt	=	0;
        if(jCheckBox1.isSelected())
        {
                bTmpAnt[0] = 1;
                iModAnt++;
                m_antenna_sel += 1;
        }

        if(jCheckBox2.isSelected())
        {
                bTmpAnt[1] = 2;
                iModAnt++;
                m_antenna_sel += 2;
        }

        if(jCheckBox3.isSelected())
        {
                bTmpAnt[2] = 4;
                iModAnt++;
                m_antenna_sel += 4;
        }

        if(jCheckBox4.isSelected())
        {
                bTmpAnt[3] = 8;
                iModAnt++;
                m_antenna_sel += 8;
        }

        for (i = 0; i < 4; i++)
        {
                if ( bTmpAnt[i] != 0 )
                {
                        gAntenna[k]	=	bTmpAnt[i];
                        k++;
                }
        }


        


        for(i=0;i<5;i++)
        {

                switch(ConnectMode)
                {
                case 0://网口,usb
                    res=ReaderAPI.EPC1G2_RStreadProtect(hScanner[0], AccessPassword, Address);
                        break;
                case 1://rs232
                    res=ReaderAPI.EPC1G2_RStreadProtect(hScanner[0], AccessPassword, Address);
                        break;
                }
                if ((res==ReaderAPI._OK))
                        break;
        }
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "UnLockRead successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "UnLockRead Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }

        
    }//GEN-LAST:event_jButton10ActionPerformed

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
        // TODO add your handling code here:
//列出标签
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank

        //1.先查地址
        strTemp = jTextField5.getText();
        m_LAddress = Integer.parseInt(strTemp);
        if ((m_LAddress<0) || (m_LAddress>2047))
	{
            //MessageBox("Please input Location of Tag Address between 0 and 2047!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Location of Tag Address between 0 and 2047!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField5.grabFocus();
            jToggleButton1.setSelected(false);
            return;

	}

        //2.查长度
        strTemp = jTextField6.getText();
        m_LLen = Integer.parseInt(strTemp);
        if ((m_LLen<0) || (m_LLen>2048))
	{
            //MessageBox("Please input Length of Tag Data between 0 and 2048!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 0 and 2048!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField6.grabFocus();
            jToggleButton1.setSelected(false);
            return;
	}

        //判断是不是16字串
        strTemp = jTextField7.getText();
        if ( !Utility.isHexString(strTemp) && !strTemp.isEmpty() ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField7.grabFocus();
            jToggleButton1.setSelected(false);
            return;
        }

        mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;
        //将字符串变为字节数组
        mask = Utility.convert2HexArray(strTemp);

        int i;
        int [] interval = new int[]{10,20,30,50,100,200,500};
        timer_interval=interval[jComboBox1.getSelectedIndex()];

        nIDEvent = 1;//是哪个事ID号, 列标签

        if ( jToggleButton1.isSelected() ){
            System.out.println("jToggleButton_Down!\n");

            int k = 0;
            byte bMode = 0;
            byte[] bTmpAnt = new byte[4];
            m_antenna_sel=0;
            bTmpAnt[0] = 0;
            bTmpAnt[1] = 0;
            bTmpAnt[2] = 0;
            bTmpAnt[3] = 0;
            gAntenna[0] = 0;
            gAntenna[1] = 0;
            gAntenna[2] = 0;
            gAntenna[3] = 0;
            iModAnt	=	0;
            if(jCheckBox1.isSelected())
            {
                    bTmpAnt[0] = 1;
                    iModAnt++;
                    m_antenna_sel += 1;
            }

            if(jCheckBox2.isSelected())
            {
                    bTmpAnt[1] = 2;
                    iModAnt++;
                    m_antenna_sel += 2;
            }

            if(jCheckBox3.isSelected())
            {
                    bTmpAnt[2] = 4;
                    iModAnt++;
                    m_antenna_sel += 4;
            }

            if(jCheckBox4.isSelected())
            {
                    bTmpAnt[3] = 8;
                    iModAnt++;
                    m_antenna_sel += 8;
            }

            for (i = 0; i < 4; i++)
            {
                    if ( bTmpAnt[i] != 0 )
                    {
                            gAntenna[k]	=	bTmpAnt[i];
                            k++;
                    }
            }



                




		//m_ListID.DeleteAllItems();
                //清除表格中的内容
                //DefaultTableModel tableModel = (DefaultTableModel)jTable1.get
                //tableModel.setRowCount(0);
                ((DefaultTableModel) jTable1.getModel()).getDataVector().clear();   //清除表格数据
                ((DefaultTableModel) jTable1.getModel()).fireTableDataChanged();//通知模型更新
                jTable1.updateUI();//刷新表格


		Read_times=0;

            //开启时间标志
            running =   true;
            //start mytimer
            mytimer=new MyTimer();
            mytimer.setInterval(timer_interval);
            mytimer.start();

        }else {
            System.out.println("jToggleButton_Up!\n");
            //关闭时间标志
            running =   false;
            //start mytimer
            mytimer.setEnd(true);
            
            
            //kill tag
            jComboBox2.removeAllItems();

            //块的读写
            jComboBox3.removeAllItems();

            //Set protect for reading or writing
            jComboBox6.removeAllItems();

            //Lock Block for User
            jComboBox4.removeAllItems();

            //Alarm
            jComboBox5.removeAllItems();

            //Read Protect
            jComboBox7.removeAllItems();


            //将表格有的数据加载到表格中
            int k=jTable1.getRowCount();
		String str;
		byte[] temp = new byte[128];
		int ID_len;

		for(i=0;i<k;i++)
		{
                    //取第i行第4列
                    strTemp = (String) jTable1.getValueAt(i, 4);
                    EPCC1G2_IDBuffer[i][0] = (byte)Integer.parseInt(strTemp, 16);
                    ID_len=EPCC1G2_IDBuffer[i][0]*2;


                    str="";
                    //取第i行第4列
                    strTemp = (String) jTable1.getValueAt(i, 1);
                    temp = Utility.convert2HexArray(strTemp);

                    System.arraycopy(temp, 0, EPCC1G2_IDBuffer[i], 1, ID_len);

                    str =  String.format("%02d.",i+1);
                    str += strTemp;

                    //kill tag
                    jComboBox2.addItem(str);

                    //块的读写
                    jComboBox3.addItem(str);

                    //Set protect for reading or writing
                    jComboBox6.addItem(str);

                    //Lock Block for User
                    jComboBox4.addItem(str);

                    //Alarm
                    jComboBox5.addItem(str);

                    //Read Protect
                    jComboBox7.addItem(str);

		}

                if (i != 0 && i == k){

                    jComboBox2.setSelectedIndex(0);
                    jComboBox3.setSelectedIndex(0);
                    jComboBox6.setSelectedIndex(0);
                    jComboBox4.setSelectedIndex(0);
                    jComboBox5.setSelectedIndex(0);
                    jComboBox7.setSelectedIndex(0);
                }



        }
    }//GEN-LAST:event_jToggleButton1ActionPerformed

    private void jToggleButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton2ActionPerformed
        // TODO add your handling code here:
//块读
        String strTemp;
        int m_LAddress = 0;
        int m_LLen = 0;
        int m_mem = 0;//bank

        //先检查EPC是否先了
        if ( jComboBox3.getItemCount() < 1 ){
            //MessageBox("Please read first than choose a tag!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please read first than choose a tag!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //1.先查地址
        strTemp = jTextField9.getText();
        m_LAddress = Integer.parseInt(strTemp);
        if ((m_LAddress<0) || (m_LAddress>2047))
	{
            //MessageBox("Please input Location of Tag Address between 0 and 2047!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Location of Tag Address more then 0!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField9.grabFocus();
            jToggleButton2.setSelected(false);
            return;
	}

        //2.查长度
        strTemp = jTextField10.getText();
        m_LLen = Integer.parseInt(strTemp);
        if ((m_LLen<1) || (m_LLen>2048))
	{
            //MessageBox("Please input Length of Tag Data more than 1!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 0 and 2048!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField10.grabFocus();
            jToggleButton2.setSelected(false);
            return;
	}

        //0---密码， 1---EPC， 2---TID， 3---USER
        if ( jRadioButton4.isSelected() ){
            m_mem = 0;//bank
        }
        if ( jRadioButton5.isSelected() ){
            m_mem = 1;//bank
        }
        if ( jRadioButton6.isSelected() ){
            m_mem = 2;//bank
        }
        if ( jRadioButton7.isSelected() ){
            m_mem = 3;//bank
        }

        mem=m_mem;
        switch(mem)
	{
	case 0x00:
            if ((m_LLen<1) || (m_LLen>4)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 4 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x02:
            if ((m_LLen<1) || (m_LLen>64)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 8 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x01:
            if ((m_LLen<1) || (m_LLen>32)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 32 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        case 0x03:
            if ((m_LLen<1) || (m_LLen>128)){
                JOptionPane.showMessageDialog(this, "Please input Length of Tag Data between 1 and 128 Word!", "Warning", JOptionPane.ERROR_MESSAGE);
                jTextField10.grabFocus();
                jToggleButton2.setSelected(false);
                return;
            }
            break;
        }

        //访问密码
        //判断是不是16字串
        strTemp = jTextField11.getText();
        if ( !Utility.isHexString(strTemp) && !strTemp.isEmpty() ){
            //MessageBox("Please input HEX!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input HEX!", "Warning", JOptionPane.ERROR_MESSAGE);
            jTextField7.grabFocus();
            jToggleButton1.setSelected(false);
            return;
        }

        if ( strTemp.length() != 8 ){
            //MessageBox("Please input enough Length of AccessPassword!","Warning",MB_ICONWARNING);
            JOptionPane.showMessageDialog(this, "Please input enough Length of AccessPassword!", "Warning", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //将字符串变为字节数组
        AccessPassword = Utility.convert2HexArray(strTemp);

        //m_mem 指0---密码，1---EPC，2---TID, 3---USER
	mem=m_mem;
	ptr=m_LAddress;
	len=m_LLen;

        int CurSel=jComboBox3.getSelectedIndex();
	EPC_Word=EPCC1G2_IDBuffer[CurSel][0];

	for(int i=0;i<EPC_Word*2;i++){
            IDTemp[i]=EPCC1G2_IDBuffer[CurSel][i+1];
	}


        int i;
        int [] interval = new int[]{10,20,30,50,100,200,500};
        timer_interval=interval[jComboBox1.getSelectedIndex()];

        nIDEvent = 2;//是哪个事ID号, 列标签

        if ( jToggleButton2.isSelected() ){
            System.out.println("jToggleButton2_Down!\n");

            int k = 0;
            byte[] bTmpAnt = new byte[4];
            m_antenna_sel=0;
            bTmpAnt[0] = 0;
            bTmpAnt[1] = 0;
            bTmpAnt[2] = 0;
            bTmpAnt[3] = 0;
            gAntenna[0] = 0;
            gAntenna[1] = 0;
            gAntenna[2] = 0;
            gAntenna[3] = 0;
            iModAnt	=	0;
            if(jCheckBox1.isSelected())
            {
                    bTmpAnt[0] = 1;
                    iModAnt++;
                    m_antenna_sel += 1;
            }

            if(jCheckBox2.isSelected())
            {
                    bTmpAnt[1] = 2;
                    iModAnt++;
                    m_antenna_sel += 2;
            }

            if(jCheckBox3.isSelected())
            {
                    bTmpAnt[2] = 4;
                    iModAnt++;
                    m_antenna_sel += 4;
            }

            if(jCheckBox4.isSelected())
            {
                    bTmpAnt[3] = 8;
                    iModAnt++;
                    m_antenna_sel += 8;
            }

            for (i = 0; i < 4; i++)
            {
                    if ( bTmpAnt[i] != 0 )
                    {
                            gAntenna[k]	=	bTmpAnt[i];
                            k++;
                    }
            }


		//m_ListID.DeleteAllItems();
                //清除表格中的内容
                //DefaultTableModel tableModel = (DefaultTableModel)jTable1.get
                //tableModel.setRowCount(0);

                jList1.removeAll();


		Read_times=0;

            //开启时间标志
            running =   true;
            //start mytimer
            mytimer=new MyTimer();
            mytimer.setInterval(timer_interval);
            mytimer.start();

        }else {
            System.out.println("jToggleButton_Up!\n");
            //关闭时间标志
            running =   false;
            //start mytimer
            mytimer.setEnd(true);



        }
    }//GEN-LAST:event_jToggleButton2ActionPerformed

    private void jToggleButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton3ActionPerformed
        // TODO add your handling code here:
//检测EAS
        String strTemp;
        
        int i;
        int [] interval = new int[]{10,20,30,50,100,200,500};
        timer_interval=interval[jComboBox1.getSelectedIndex()];

        nIDEvent = 3;//是哪个事ID号, 列标签

        if ( jToggleButton3.isSelected() ){
            System.out.println("jToggleButton_Down!\n");

            int k = 0;
            byte[] bTmpAnt = new byte[4];
            m_antenna_sel=0;
            bTmpAnt[0] = 0;
            bTmpAnt[1] = 0;
            bTmpAnt[2] = 0;
            bTmpAnt[3] = 0;
            gAntenna[0] = 0;
            gAntenna[1] = 0;
            gAntenna[2] = 0;
            gAntenna[3] = 0;
            iModAnt	=	0;
            if(jCheckBox1.isSelected())
            {
                    bTmpAnt[0] = 1;
                    iModAnt++;
                    m_antenna_sel += 1;
            }

            if(jCheckBox2.isSelected())
            {
                    bTmpAnt[1] = 2;
                    iModAnt++;
                    m_antenna_sel += 2;
            }

            if(jCheckBox3.isSelected())
            {
                    bTmpAnt[2] = 4;
                    iModAnt++;
                    m_antenna_sel += 4;
            }

            if(jCheckBox4.isSelected())
            {
                    bTmpAnt[3] = 8;
                    iModAnt++;
                    m_antenna_sel += 8;
            }

            for (i = 0; i < 4; i++)
            {
                    if ( bTmpAnt[i] != 0 )
                    {
                            gAntenna[k]	=	bTmpAnt[i];
                            k++;
                    }
            }





		Read_times=0;

            //开启时间标志
            running =   true;
            //start mytimer
            mytimer=new MyTimer();
            mytimer.setInterval(timer_interval);
            mytimer.start();

        }else {
            System.out.println("jToggleButton_Up!\n");
            //关闭时间标志
            running =   false;
            //start mytimer
            mytimer.setEnd(true);



        }
        
        
    }//GEN-LAST:event_jToggleButton3ActionPerformed

    private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton1ActionPerformed
        // TODO add your handling code here:
        //System.out.println("jRadioButton1ActionPerformed!\n");
        jComboBox_ports.setEnabled(false);
        
        jTextField1.setEnabled(true);
        jTextField2.setEnabled(true);
        jTextField3.setEnabled(true);
        jTextField4.setEnabled(true);
        
    }//GEN-LAST:event_jRadioButton1ActionPerformed

    private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButton2ActionPerformed
        // TODO add your handling code here:
        //System.out.println("jRadioButton2ActionPerformed!\n");
        jComboBox_ports.setEnabled(true);
        
        jTextField1.setEnabled(false);
        jTextField2.setEnabled(false);
        jTextField3.setEnabled(false);
        jTextField4.setEnabled(false);
        
    }//GEN-LAST:event_jRadioButton2ActionPerformed

    private void jTabbedPaneFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTabbedPaneFocusGained
        // TODO add your handling code here:
        System.out.println("jTabbedPaneFocusGained!\n");
    }//GEN-LAST:event_jTabbedPaneFocusGained

    private void jTabbedPaneFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTabbedPaneFocusLost
        // TODO add your handling code here:
        System.out.println("jTabbedPaneFocusLost!\n");
    }//GEN-LAST:event_jTabbedPaneFocusLost

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        //Get ID
        System.out.println("jButton1ActionPerformed!\n");
        
        byte[] sID = new byte[18];
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.GetHandsetID(hScanner[0], sID);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.GetHandsetID(hScanner[0], sID);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            String str = new String(sID);
            jTextField18.setText(str);
        }
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        // TODO add your handling code here:
        //Set ID
        System.out.println("jButton3ActionPerformed!\n");
        
        String sText;
        sText = jTextField18.getText();
        byte sID[] = sText.getBytes();
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.SetHandsetID(hScanner[0], sID);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.SetHandsetID(hScanner[0], sID);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set ID Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set ID Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
        
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton12ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton12ActionPerformed
        // TODO add your handling code here:
        //GetTime
        System.out.println("jButton12ActionPerformed!\n");
        
        byte[] sTime = new byte[18];
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.GetReaderTime(hScanner[0], sTime);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.GetReaderTime(hScanner[0], sTime);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            String str = String.format("20%02d-%02d-%02d %02d:%02d:%02d", sTime[0],sTime[1],sTime[2],sTime[3],sTime[4],sTime[5]);
            jTextField23.setText(str);
        }
    }//GEN-LAST:event_jButton12ActionPerformed

    private void jButton13ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton13ActionPerformed
        // TODO add your handling code here:
        //SetTime
        System.out.println("jButton13ActionPerformed!\n");
        byte[] sTime = new byte[6];
        String sText;
        
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
        sText = df.format(new Date());
        
        //sText = jTextField23.getText();
        //sText = sText.trim();
        sText = sText.replace("-", " ");
        sText = sText.replace(":", " ");
        String[] a = sText.split(" ");
        a[0] = a[0].substring(2,4);
        
        for(int i = 0; i < 6; i++)
        {
            sTime[i] = Byte.parseByte(a[i]);
        }
        
        ReaderDate TmpReaderDate=new ReaderDate();
        TmpReaderDate.Year = sTime[0];
        TmpReaderDate.Month = sTime[1];
        TmpReaderDate.Day = sTime[2];
        TmpReaderDate.Hour = sTime[3];
        TmpReaderDate.Minute = sTime[4];
        TmpReaderDate.Second = sTime[5];
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.SetReaderTime(hScanner[0], TmpReaderDate);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.SetReaderTime(hScanner[0], TmpReaderDate);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set ID Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set ID Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
    }//GEN-LAST:event_jButton13ActionPerformed

    private void jButton14ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton14ActionPerformed
        // TODO add your handling code here:
        //SetFilter//设置标签过滤器
        //public short SetReportFilter(int hScanner, int ptr, int len, byte[] mask);
        
        int ptr=0;
        int len=0;
        
        String strPos = jTextField24.getText();
        String strLen = jTextField25.getText();
        String strMask = jTextField26.getText();
        byte[] mask = Utility.convert2HexArray(strMask);
        
        ptr = Integer.parseInt(strPos);
        len = Integer.parseInt(strLen);
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.SetReportFilter(hScanner[0], ptr, len, mask);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.SetReportFilter(hScanner[0], ptr, len, mask);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set Filter Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set Filter Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
        
    }//GEN-LAST:event_jButton14ActionPerformed

    private void jButton15ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton15ActionPerformed
        // TODO add your handling code here:
        //GetFilter
        //获得标签过滤器
        System.out.println("jButton12ActionPerformed!\n");
        
        int[] ptr = new int[1];
        int[] len = new int[1];
        byte[] mask = new byte[32];
        
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.GetReportFilter(hScanner[0], ptr, len, mask);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.GetReportFilter(hScanner[0], ptr, len, mask);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            String strPos = String.format("%d", ptr[0]);
            jTextField24.setText(strPos);
            String strLen = String.format("%d", len[0]);
            jTextField25.setText(strLen);
            String strMask = Utility.bytes2HexString(mask, 1);
            jTextField26.setText(strMask);
            
        }
        
    }//GEN-LAST:event_jButton15ActionPerformed

    private void jButton18ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton18ActionPerformed
        // TODO add your handling code here:
        //SetBlueToothName
        //设置蓝牙名称
        System.out.println("jButton18ActionPerformed!\n");
        
        String sText;
        sText = jTextField31.getText();
        sText = sText.trim();
        byte sID[] = sText.getBytes();
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.SetBluetoothName(hScanner[0], sID.length, sID);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.SetBluetoothName(hScanner[0], sID.length, sID);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set BluetoochName Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set BluetoochName Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
        
    }//GEN-LAST:event_jButton18ActionPerformed

    private void jButton19ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton19ActionPerformed
        // TODO add your handling code here:
        //GetBlueToothName
        //获得蓝牙名称
        System.out.println("jButton19ActionPerformed!\n");
        
        byte[] sID = new byte[33];
        for(int i = 0; i < 32; i++)
        {
            sID[i] = 0;
        }
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.GetBluetoothName(hScanner[0], sID);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.GetBluetoothName(hScanner[0], sID);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==READERDLL._OK)
        {
            for(int i = 0; i < 32; i++)
            {
                if ( sID[i] <= 0 ) sID[i] = 0x20;
            }
            String str = new String(sID);
            str = str.trim();
            jTextField31.setText(str);
        }
        
    }//GEN-LAST:event_jButton19ActionPerformed

    private void jButton20ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton20ActionPerformed
        // TODO add your handling code here:
        //SetBlueToothRate
        //设置蓝牙波特率
        System.out.println("jButton20ActionPerformed!\n");
        
        int nBaudRate = 0;
        nBaudRate = jComboBox11.getSelectedIndex()+4;
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.SetBtBaudRate(hScanner[0], nBaudRate);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.SetBtBaudRate(hScanner[0], nBaudRate);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Set BluetoochRate Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Set BluetoochRate Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
                
    }//GEN-LAST:event_jButton20ActionPerformed

    private void jButton21ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton21ActionPerformed
        // TODO add your handling code here:
        //GetBlueToothRate
        //获取蓝牙波特率
        System.out.println("jButton20ActionPerformed!\n");
        
        int[] nBaudRate = new int[1];
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.GetBtBaudRate(hScanner[0], nBaudRate);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.GetBtBaudRate(hScanner[0], nBaudRate);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==READERDLL._OK)
        {
            jComboBox11.setSelectedIndex(nBaudRate[0]-4);
        }

    }//GEN-LAST:event_jButton21ActionPerformed

    private void jButton22ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton22ActionPerformed
        // TODO add your handling code here:
        //Download
        //下载数据
	int   nYear,nMonth,nDate,nHou,nMin,nSec;
	int i,getcount;
        int nTotal[] = new int[1];
	int recordlen	=	0;
	int j=0;
        int k=0;
	byte stime[] = new byte[6];
        byte etime[] = new byte[6];
        byte data[] = new byte[254*10];
	
	int nS,nRow;

	int nRecordNums[] = new int[1];//记录总数
	int niDiRecord[] = new int[1];//第几条

	ReaderDate TmpReaderDateSTime=new ReaderDate();
        ReaderDate TmpReaderDateETime=new ReaderDate();
	
	if(0==ifConnectReader)
	{
		JOptionPane.showMessageDialog(this, "Can't connect a handset !", "Warning", JOptionPane.ERROR_MESSAGE);
		return;
	}

	SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式

	//String m_StartTime = df.format(new Date());
	//String m_EndTime = df.format(new Date());
	String m_StartTime = jTextField33.getText();
	String m_EndTime = jTextField34.getText();

	if ( jCheckBox10.isSelected() == true )
	{
		m_StartTime = "";
                m_EndTime = "";
	}

	if((m_StartTime.length()==0)&&(m_StartTime.length()==0))
	{
		stime[0]=0;
		stime[1]=0;
		stime[2]=0;
		stime[3]=0;
		stime[4]=0;
		stime[5]=0;

		etime[0]=0;
		etime[1]=0;
		etime[2]=0;
		etime[3]=0;
		etime[4]=0;
		etime[5]=0;
	}
	else
	{
		if(m_StartTime.length()==0)
		{
			return;
		}
		if(m_EndTime.length()==0)
		{
			return;
		}
                
                String sText;
                sText = m_StartTime;
                sText = sText.trim();
                sText = sText.replace("-", " ");
                sText = sText.replace(":", " ");
                String[] a = sText.split(" ");
                a[0] = a[0].substring(2,4);

                for(i = 0; i < 6; i++)
                {
                    stime[i] = Byte.parseByte(a[i]);
                }
                TmpReaderDateSTime.Year   = stime[0];
                TmpReaderDateSTime.Month  = stime[1];
                TmpReaderDateSTime.Day    = stime[2];
                TmpReaderDateSTime.Hour   = stime[3];
                TmpReaderDateSTime.Minute = stime[4];
                TmpReaderDateSTime.Second = stime[5];
		
                sText = m_EndTime;
                sText = sText.trim();
                sText = sText.replace("-", " ");
                sText = sText.replace(":", " ");
                String[] b = sText.split(" ");
                b[0] = b[0].substring(2,4);

                for(i = 0; i < 6; i++)
                {
                    etime[i] = Byte.parseByte(b[i]);
                }
                TmpReaderDateETime.Year   = etime[0];
                TmpReaderDateETime.Month  = etime[1];
                TmpReaderDateETime.Day    = etime[2];
                TmpReaderDateETime.Hour   = etime[3];
                TmpReaderDateETime.Minute = etime[4];
                TmpReaderDateETime.Second = etime[5];
		
	}

	//先发一个总数记录
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.VH_GetRecordNum(hScanner[0], TmpReaderDateSTime, TmpReaderDateETime, nRecordNums);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.VH_GetRecordNum(hScanner[0], TmpReaderDateSTime, TmpReaderDateETime, nRecordNums);
                
                break;
        }
	
	if ( res != READERDLL._OK )
	{
                JOptionPane.showMessageDialog(this, "Download false!", "Warning", JOptionPane.ERROR_MESSAGE);
		return;
	}


	//进度条准备工作
	

        //
        
        //清除表格中的内容
        ((DefaultTableModel) jTable2.getModel()).getDataVector().clear();   //清除表格数据
        ((DefaultTableModel) jTable2.getModel()).fireTableDataChanged();    //通知模型更新
        jTable2.updateUI();//刷新表格
	
        String str="";
        String strtmp="";
	getcount=0;
        nS= 0;
	while(true)
	{
                //res = GetRecord(m_hScanner, (ReaderDate *)stime, (ReaderDate *)etime, &nTotal, &recordlen, data);
                switch (ConnectMode){
                case 0://U口
                    //USB
                    res = ReaderAPI.VH_GetRecord(hScanner[0], TmpReaderDateSTime, TmpReaderDateETime, nTotal, niDiRecord, data);
                    break;
                case 1://串口
                    //RS232
                    res = ReaderAPI.VH_GetRecord(hScanner[0], TmpReaderDateSTime, TmpReaderDateETime, nTotal, niDiRecord, data);

                    break;
                }
		if(res != READERDLL._OK)
		{
			JOptionPane.showMessageDialog(this, "Download false1!", "Warning", JOptionPane.ERROR_MESSAGE);
			break;
		}

		if((getcount==0)&&(nTotal[0]==0))
		{
			JOptionPane.showMessageDialog(this, "Empty record in handset!", "Warning", JOptionPane.ERROR_MESSAGE);
                        res = -1;
			break;
		}

		if(nTotal[0] == 0)
		{
                    res = -1;
                    break;
		}

                
		//进度提示
                
                k=4;
		for(i=0;i<1;i++)
		{
			
			String strNo = String.format("%d",nS+1); //第几个
			String strTime=String.format("%04d-%02d-%02d %02d:%02d:%02d", data[0+k]+2000, data[1+k], data[2+k], data[3+k], data[4+k], data[5+k]); 
			String strEpc="";
                        String strTID="";
                        String strUser="";

			if(data[6+k]==0x04)//TagType
			{
				str=""; 
				for(j=0;j<data[7+k]*2;j++)//EPCLen
				{
					strtmp=String.format("%02X",data[8+k+j]);//EPC
					str+=strtmp;
				}
				strEpc = str;

				str="";
				for(j=0;j<data[24+k]*2;j++)
				{
					strtmp=String.format("%02X",data[25+k+j]);//TID
					str+=strtmp;
				}
				strTID = str;

				str="";
				for(j=0;j<data[33+k]*2;j++)
				{
					strtmp=String.format("%02X",data[34+k+j]);
					str+=strtmp;
				}
				strUser = str;
			}
			else
			{
				str="";
				for(j=0;j<data[7+k]*2;j++)
				{
					strtmp=String.format("%02X",data[8+k+j]);//EPC
					str+=strtmp;
				}
				strEpc = str;

				str="";
				for(j=0;j<data[33+k]*2;j++)
				{
					strtmp=String.format("%02X",data[34+k+j]);
					str+=strtmp;
				}
				strUser = str;
			}
                        
                        DefaultTableModel model = (DefaultTableModel) jTable2.getModel();
                        model.addRow(new Object[]{
                                strNo,          //0
                                strTime,         //1
                                strEpc,     //2
                                strTID,       //3
                                strUser         //4
                                });
                        
                        nS=nS+1;
		}

		
		getcount++;
	}

	if((getcount != 0)&&(res == READERDLL._OK))
	{
		String sTot="";
		String sTit="";
		sTot=String.format("%02d %02d", niDiRecord[0],getcount);
		//str	=	_T("Download successfully!");
		//sTit=	_T("Notice");
		str	= "Download successfully!";
		sTit    =("Notice");

		str	+=	sTot;
                JOptionPane.showMessageDialog(this, str, sTit, JOptionPane.INFORMATION_MESSAGE);
	}

	return;
        
    }//GEN-LAST:event_jButton22ActionPerformed

    
    
    private void jButton24ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton24ActionPerformed
        // TODO add your handling code here:
        //高速获得记录
        //清除表格中的内容
        ((DefaultTableModel) jTable2.getModel()).getDataVector().clear();   //清除表格数据
        ((DefaultTableModel) jTable2.getModel()).fireTableDataChanged();    //通知模型更新
        jTable2.updateUI();//刷新表格
        
        System.out.println("jButton24ActionPerformed!\n");
        //执行用户自定义测试用
        //dialog.jButton24.setText("Hella");
        

        //高速下载测试用
//        res = ReaderAPI.VH_GetRecordHighTest(hScanner[0], new READERDLL.MyCallInterfaceTest() {
//
//            int icount=0;
//            
//            @Override
//            public short invoke() {
//                System.out.println("invoke!\n");
//                
//                
//                //dialog.jButton24.setText("Hello");
//                
//                //throw new UnsupportedOperationException("Not supported yet.");
//                return 0;
//            }
//        });
        
        
        //高速下载
        res = ReaderAPI.VH_GetRecordHighTestS(hScanner[0], new READERDLL.MyCallInterfaceTestS() {

            int icount=1;
            int nS = 0;
            
            @Override
            public short invoke(String lpBuf) {
                System.out.println("invoke["+icount+"]\n");
                //System.out.println(Data);
                
                //if (false){
                if (true){
                String[] arrayB = lpBuf.split(" ");
                byte [] data = new byte[arrayB.length+1];
                for(int i = 0; i < arrayB.length; i++)
                {
                    data[i] = (byte)Integer.parseInt(arrayB[i], 16);
                }
                
                int j = 0;
                String str = "";
                String strtmp = "";
                
                int k = 5;
                String strNo = String.format("%d",nS+1); //第几个
			String strTime=String.format("%04d-%02d-%02d %02d:%02d:%02d", data[0+k]+2000, data[1+k], data[2+k], data[3+k], data[4+k], data[5+k]); 
			String strEpc="";
                        String strTID="";
                        String strUser="";

			if(data[6+k]==0x04)//TagType
			{
				str=""; 
				for(j=0;j<data[7+k]*2;j++)//EPCLen
				{
					strtmp=String.format("%02X",data[8+k+j]);//EPC
					str+=strtmp;
				}
				strEpc = str;

				str="";
				for(j=0;j<data[24+k]*2;j++)
				{
					strtmp=String.format("%02X",data[25+k+j]);//TID
					str+=strtmp;
				}
				strTID = str;

				str="";
				for(j=0;j<data[33+k]*2;j++)
				{
					strtmp=String.format("%02X",data[34+k+j]);
					str+=strtmp;
				}
				strUser = str;
			}
			else
			{
				str="";
				for(j=0;j<data[7+k]*2;j++)
				{
					strtmp=String.format("%02X",data[8+k+j]);//EPC
					str+=strtmp;
				}
				strEpc = str;

				str="";
				for(j=0;j<data[33+k]*2;j++)
				{
					strtmp=String.format("%02X",data[34+k+j]);
					str+=strtmp;
				}
				strUser = str;
			}
                        
                        DefaultTableModel model = (DefaultTableModel) jTable2.getModel();
                        model.addRow(new Object[]{
                                strNo,          //0
                                strTime,         //1
                                strEpc,     //2
                                strTID,       //3
                                strUser         //4
                                });
                        
                        nS=nS+1;
                
                
                //dialog.jButton24.setText("Hello");
                }
                
                icount = icount + 1;
                
                //throw new UnsupportedOperationException("Not supported yet.");
                return 0;
               }
            
        });
        
        
        
        
        
    }//GEN-LAST:event_jButton24ActionPerformed

    private void jButton23ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton23ActionPerformed
        // TODO add your handling code here:
        //Delete
        System.out.println("jButton23ActionPerformed!\n");
        
        Object[] options = {"OK","Cancel"};
        int response=JOptionPane.showOptionDialog(this, "Are you sure to Delete all record?", "Warning",JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        if(response==0)
        {

        }
        else if(response==1)
        {
            //NO
            return;
        }
        
        switch (ConnectMode){
            case 0://U口
                //USB
                res = ReaderAPI.DeleteAllRecord(hScanner[0]);
                break;
            case 1://串口
                //RS232
                res = ReaderAPI.DeleteAllRecord(hScanner[0]);
                
                break;
        }
        
        //byte b[] = s.getBytes();//String转换为byte[]  String t = new String(b);//bytep[]转换为String
        if (res==ReaderAPI._OK)
        {
            JOptionPane.showMessageDialog(this, "Delete Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "Delete Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
        }
        
    }//GEN-LAST:event_jButton23ActionPerformed

    private void jButton25ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton25ActionPerformed
        // TODO add your handling code here:
        // Add
        //增加
        int k=jTable3.getRowCount();
        String strNo = String.format("%d", k+1);
        String strTime = jTextField35.getText();
        DefaultTableModel model = (DefaultTableModel) jTable3.getModel();
        model.addRow(new Object[]{
                strNo,          //0
                strTime,         //1

                });
                        
    }//GEN-LAST:event_jButton25ActionPerformed

    private void jButton26ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton26ActionPerformed
        // TODO add your handling code here:
        // Del
        // 删除
        int row = jTable3.getSelectedRow();
        if (row >=0 ){
        ((DefaultTableModel) jTable3.getModel()).getDataVector().remove(row);   //清除表格数据
        jTable3.updateUI();//刷新表格
        }
        
    }//GEN-LAST:event_jButton26ActionPerformed

    private void jButton27ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton27ActionPerformed
        // TODO add your handling code here:
        // GetName
        // 获取名单
        
	int nAddr = 0;
        int nCount= 0;
        int [] nTotal = new int[1];
        int [] nDataLen = new int[1];
	byte[] data = new byte[32*17];
	int dchar;
	String str;
	int nS,nRow;
	int getcount=0;
	
	
	//名单列表
	//清除表格中的内容
        ((DefaultTableModel) jTable3.getModel()).getDataVector().clear();   //清除表格数据
        ((DefaultTableModel) jTable3.getModel()).fireTableDataChanged();    //通知模型更新
        jTable3.updateUI();//刷新表格
	nAddr=0;
	while(true)
	{
		nCount=0;
		switch (ConnectMode){
                case 0://U口
                    //USB
                    res = ReaderAPI.GetLableID(hScanner[0], nAddr, nCount, nTotal, nDataLen, data);
                    break;
                case 1://串口
                    //RS232
                    res = ReaderAPI.GetLableID(hScanner[0], nAddr, nCount, nTotal, nDataLen, data);
                
                    break;
                }
		if(res != READERDLL._OK)
		{
                    JOptionPane.showMessageDialog(this, "GetLableID Fail!", "Warning", JOptionPane.ERROR_MESSAGE);
                    break;
		}
		
		if((getcount==0)&&(nTotal[0]==0))
		{
                    //MessageBox("Empty LableID in handset!","Notice",MB_ICONINFORMATION);
                    JOptionPane.showMessageDialog(this, "Empty LableID in handset!", "Warning", JOptionPane.ERROR_MESSAGE);
                    break;
		}
		
		int k = 0;
		int len=0;
		int sumlen=0;
		String olddata;
		//len=data[k]*2;
		sumlen=1;
		for(int i=0;i<nTotal[0];i++)
		{
                    String strNo;
                    String strID;
			
                        nS=jTable3.getRowCount();
			strNo = String.format("%d",nS+1);
			
			
			strID = "";
			len=data[k];
			for(int j=0;j<len*2;j++)
			{
				dchar=data[k+1+j]>>4;
				olddata = String.format("%X",dchar);
				strID=strID+olddata;
				dchar=data[k+1+j]&0x0F;
				olddata = String.format("%X",dchar);
				strID=strID+olddata;
			}
			

                        
                        DefaultTableModel model = (DefaultTableModel) jTable3.getModel();
                        model.addRow(new Object[]{
                                strNo,          //0
                                strID         //1
                                });
                        
			k += len*2+1;
		}
		
		if(nTotal[0] == 0)
		{
			break;
		}
		else
		{
			nAddr=nAddr+nTotal[0];
		}
		
		getcount++;
	}
	
	if((getcount != 0)&&(res == READERDLL._OK))
	{
            JOptionPane.showMessageDialog(this, "Download successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
	}
	
	

    }//GEN-LAST:event_jButton27ActionPerformed

    private void jButton28ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton28ActionPerformed
        // TODO add your handling code here:
        // DelName
        // 删除名单
        Object[] options = {"OK","Cancel"};
        int response=JOptionPane.showOptionDialog(this, "Are you sure to erase all LableID in handset?", "Warning",JOptionPane.YES_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
        if(response==0)
        {

        }
        else if(response==1)
        {
            //NO
            return;
        }
        
	switch (ConnectMode){
        case 0://U口
            //USB
            res=ReaderAPI.DelLableID(hScanner[0]);
            break;
        case 1://串口
            //RS232
            res=ReaderAPI.DelLableID(hScanner[0]);

            break;
        }
	if (res==READERDLL._OK)
        {
            JOptionPane.showMessageDialog(this, "Erase successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
        }
        else
        {
            JOptionPane.showMessageDialog(this, "fail to erase LableID in handset !", "Warning", JOptionPane.ERROR_MESSAGE);
        }
        
    }//GEN-LAST:event_jButton28ActionPerformed

    private void jButton29ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton29ActionPerformed
        // TODO add your handling code here:
        // AddName
        // 增加名单
        //增加名单
	int nCount = 0;
        int nLen = 0;
	byte[] data = new byte[32*17];
	String str;
        String strTemp;
	int str_len;
        int k = 1;
	
	
	//名单列表
	int nRow = jTable3.getRowCount();
	for(int i=0;i<nRow;i++)
	{
            str = (String) jTable3.getValueAt(i, 1);
		
		str_len=str.length()/2;
		
		k = 1;
		for(int j=0;j<str.length();j+=2)
		{
			strTemp  = str.substring(j, j+2);
                        data[k] = (byte)Integer.parseInt(strTemp, 16);
                        k++;
		}
		
		nCount=1;
		nLen=str_len+1;
		data[0]=(byte)(str_len/2);
                
                switch (ConnectMode){
                case 0://U口
                    //USB
                    res=ReaderAPI.AddLableID(hScanner[0], nCount, 17, data);
                    break;
                case 1://串口
                    //RS232
                    res=ReaderAPI.AddLableID(hScanner[0], nCount, 17, data);

                    break;
                }
		if(res!=READERDLL._OK)
		{
			break;
		}
	}
	
	if(res!=READERDLL._OK)
	{
		JOptionPane.showMessageDialog(this, "fail to add LableID in handset !", "Warning", JOptionPane.ERROR_MESSAGE);
	}
	else
	{
		
                JOptionPane.showMessageDialog(this, "Add successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
                
	}
        
        
    }//GEN-LAST:event_jButton29ActionPerformed

    private void jButton30ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton30ActionPerformed
        // TODO add your handling code here:
        // SaveName
        // 保存名单
        //保存名单
        switch (ConnectMode){
        case 0://U口
            //USB
            res=ReaderAPI.SaveLableID(hScanner[0]);
            break;
        case 1://串口
            //RS232
            res=ReaderAPI.SaveLableID(hScanner[0]);

            break;
        }
	if(res == READERDLL._OK)
	{
            JOptionPane.showMessageDialog(this, "Save successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
	}
	else
	{
            JOptionPane.showMessageDialog(this, "fail to save LableID in handset !", "Warning", JOptionPane.ERROR_MESSAGE);
	}

        
    }//GEN-LAST:event_jButton30ActionPerformed

    private void jButton31ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton31ActionPerformed
        // TODO add your handling code here:
        // Del Single Name
        // 删除单个名单
        //删除单个或多个名单
	int nCount = 0;
        int nLen = 0;
	byte[] data = new byte[30*17];
	String str;
	String strTemp;
	int str_len;
        int k = 0;
	
	
	//名单列表
        int row = jTable3.getSelectedRow();
        if (row >=0 ){
        
        
		str = (String) jTable3.getValueAt(row, 1);
		
		str_len=str.length()/2;
		
		k = 1;
		for(int j=0;j<str.length();j+=2)
		{
			strTemp  = str.substring(j, j+2);
                        data[k] = (byte)Integer.parseInt(strTemp, 16);
                        k++;
		}
		
		nCount=1;
		nLen=str_len+1;
		data[0]=(byte)(str_len/2);
                
                switch (ConnectMode){
                case 0://U口
                    //USB
                    res=ReaderAPI.DelSingleLableID(hScanner[0], nCount, nLen,data);
                    break;
                case 1://串口
                    //RS232
                    res=ReaderAPI.DelSingleLableID(hScanner[0], nCount, nLen,data);

                    break;
                }
		
		
		
		
	}
	else
	{
                JOptionPane.showMessageDialog(this, "请选中表格中有数据的行!", "Warning", JOptionPane.ERROR_MESSAGE);
		
	}


	if(res == READERDLL._OK)
	{
		
		JOptionPane.showMessageDialog(this, "Erase successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
	}
	else
	{
		
		JOptionPane.showMessageDialog(this, "fail to erase LableID in handset !!", "Warning", JOptionPane.ERROR_MESSAGE);
	}
	
        
    }//GEN-LAST:event_jButton31ActionPerformed

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
        // TODO add your handling code here:
        //Write Param
        String str_temp;
        
        int m_Alarm=0;
        boolean bFlag = jCheckBox9.isSelected();
        if (false == bFlag)
        {
            m_Alarm=0;
        }
        
        bFlag = jCheckBox8.isSelected();
        if (bFlag)
        {
            m_Alarm+=2;
        }
        gHandParam[0].Alarm = (byte)m_Alarm;
        
        //输出方式
        int m_OutputType = gHandParam[0].OutputMode;
        bFlag = jRadioButton26.isSelected();//Save and Output
        if (bFlag)
        {
            m_OutputType=0x00;
        }
        bFlag = jRadioButton27.isSelected();//Save 
        if (bFlag)
        {
            m_OutputType=0x01;
        }
        bFlag = jRadioButton28.isSelected();//Output
        if (bFlag)
        {
            m_OutputType=0x02;
        }
        gHandParam[0].OutputMode =(byte)m_OutputType;
        
            
        //标签类型
        bFlag = jRadioButton24.isSelected();//6B
        if (bFlag)
        {
            gHandParam[0].TagType=0x01;
        }
        bFlag = jRadioButton25.isSelected();//6C
        if (bFlag)
        {
            gHandParam[0].TagType=0x04;
        }
        
            
        bFlag = jCheckBox5.isSelected();//是否是TID区
        if (bFlag)
        {
            gHandParam[0].ISTID=0x01;
        }
        else
        {
            gHandParam[0].ISTID=0x00;
        }
            
        str_temp = jTextField19.getText();//TID读取位置
        gHandParam[0].TIDAddr = Byte.parseByte(str_temp);
            
        str_temp = jTextField20.getText();//TID读取长度
        gHandParam[0].TIDLen = Byte.parseByte(str_temp);
	
        
        
        bFlag = jCheckBox6.isSelected();//是否是User区
        if (bFlag)
        {
            gHandParam[0].ISUSER=0x01;
        }
        else
        {
            gHandParam[0].ISUSER=0x00;
        }
            
        str_temp = jTextField21.getText();//User读取位置
        gHandParam[0].USERAddr = Byte.parseByte(str_temp);
            
        str_temp = jTextField22.getText();//User读取长度
        gHandParam[0].USERLen = Byte.parseByte(str_temp);
        
        
        bFlag = jCheckBox7.isSelected();//电机振动,0-不，1-振动	
        if (bFlag)
        {
            gHandParam[0].ISVibrate=0x01;
        }
        else
        {
            gHandParam[0].ISVibrate=0x00;
        }

        //////////////////////////////////////////////////////////////////
        switch (ConnectMode){
        case 0://U口
            //USB
            res = ReaderAPI.WriteHanderParam(hScanner[0], gHandParam);
            break;
        case 1://串口
            //RS232
            res = ReaderAPI.WriteHanderParam(hScanner[0], gHandParam);

            break;
        }
        if(res == READERDLL._OK)
	{
		
		JOptionPane.showMessageDialog(this, "Param successfully!!!", "Notice", JOptionPane.INFORMATION_MESSAGE);
	}
	else
	{
		
		JOptionPane.showMessageDialog(this, "fail to Param !!!", "Warning", JOptionPane.ERROR_MESSAGE);
	}
        
        
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
        // TODO add your handling code here:
        //Read Param
        int i = 0;
        //HandsetParam gHandParam[] = new HandsetParam[1];//上面有定义
        for (i = 0; i < 3; i++)
        {
            //Thread.sleep(30);
            switch(ConnectMode)
            {
            case 0://U口
                res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                    break;
            case 1://RS232
                res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                    break;

            }

            if ( res == READERDLL._OK )
            {
                    break;
            }
        }
        if (res!=READERDLL._OK)
        {
                //MessageBox("Connect Reader Fail!(ReadHanderParam)","Warning",MB_ICONWARNING);
                JOptionPane.showMessageDialog(this, "Connect Reader Fail!(ReadHanderParam)", "Warning", JOptionPane.ERROR_MESSAGE);
                //调关闭
                
        }
        
        
        //////////////////////////////////////////////////////////////////
            //buzzer
            int m_Alarm=gHandParam[0].Alarm & 0x01;
            if ( 1 == m_Alarm )
            {
                jCheckBox9.setSelected(true);
            }
            else
            {
                jCheckBox9.setSelected(false);
            }
            
            //名单
            int m_IsLable=(gHandParam[0].Alarm>>1)&0x01;
            if ( 1 == m_Alarm )
            {
                jCheckBox8.setSelected(true);
            }
            else
            {
                jCheckBox8.setSelected(false);
            }
            
            //标签类型
            if(gHandParam[0].TagType==0x01)
            {
                jRadioButton24.setSelected(true);//6B
            }
            else
            {
                jRadioButton24.setSelected(false);//6B
            }
            if(gHandParam[0].TagType==0x04)
            {
                jRadioButton25.setSelected(true);//6C
            }
            else
            {
                jRadioButton25.setSelected(false);//6C                
            }
            
            //输出方式
            int m_OutputType = gHandParam[0].OutputMode;
            if(m_OutputType==0x00)
            {
                jRadioButton26.setSelected(true);//Save and Output
            }
            if(m_OutputType==0x01)
            {
                jRadioButton27.setSelected(true);//Save 
            }
            if(m_OutputType==0x02)
            {
                jRadioButton28.setSelected(true);//Output
            }
            
            //波特玄
            jComboBox8.setSelectedIndex(gHandParam[0].USBBaudRate-4);
            //发射功率
            int m_Power=gHandParam[0].Power;
	    jTextField29.setText(""+m_Power);
        
            int m_IsTID=gHandParam[0].ISTID;//是否是TID区
            if ( 1 == m_IsTID )
            {
                jCheckBox5.setSelected(true);
            }
            else
            {
                jCheckBox5.setSelected(false);
            }
	
            int m_TIDAddr=gHandParam[0].TIDAddr;//TID读取位置
            jTextField19.setText(""+m_TIDAddr);


            int m_TIDLen=gHandParam[0].TIDLen;//TID读取长度
            jTextField20.setText(""+m_TIDLen);


            int m_IsUSER=gHandParam[0].ISUSER;//是否是User区
            if ( 1 == m_IsUSER )
            {
                jCheckBox6.setSelected(true);
            }
            else
            {
                jCheckBox6.setSelected(false);
            }


            int m_USERAdder=gHandParam[0].USERAddr;//User读取位置
            jTextField21.setText(""+m_USERAdder);


            int m_USERLen=gHandParam[0].USERLen;//User读取长度
            jTextField22.setText(""+m_USERLen);


            //ISVibrate;		//电机振动,0-不，1-振动													(18)
            int m_IsVibrate=gHandParam[0].ISVibrate;
            if ( 1 == m_IsVibrate )
            {
                jCheckBox7.setSelected(true);
            }
            else
            {
                jCheckBox7.setSelected(false);
            }
        
            //////////////////////////////////////////////////////////////////
            
    }//GEN-LAST:event_jButton11ActionPerformed

    private void jButton16ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton16ActionPerformed
        // TODO add your handling code here:
        //Read Param
        //下面
        int i = 0;
        //HandsetParam gHandParam[] = new HandsetParam[1];//上面有定义
        for (i = 0; i < 3; i++)
        {
            //Thread.sleep(30);
            switch(ConnectMode)
            {
            case 0://U口
                res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                    break;
            case 1://RS232
                res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                    break;

            }

            if ( res == READERDLL._OK )
            {
                    break;
            }
        }
        if (res!=READERDLL._OK)
        {
                //MessageBox("Connect Reader Fail!(ReadHanderParam)","Warning",MB_ICONWARNING);
                JOptionPane.showMessageDialog(this, "Connect Reader Fail!(ReadHanderParam)", "Warning", JOptionPane.ERROR_MESSAGE);
                //调关闭
                
        }
        
        
        //////////////////////////////////////////////////////////////////
            //buzzer
            String str_temp;
            //波特率
            jComboBox8.setSelectedIndex(gHandParam[0].USBBaudRate-4);
            jComboBox9.removeAllItems();
            jComboBox9.setEditable(false);
            jComboBox10.removeAllItems();
            jComboBox10.setEditable(false);
                       
            int SoftVersion=gHandParam[0].RFSoftVer1*0x100+gHandParam[0].RFSoftVer2;
            int HardVersion=gHandParam[0].RFhrdVer1*0x100+gHandParam[0].RFhrdVer2;
            
            int NumofFreq;
            double Freq,jumpFreq;
            boolean ischina=false;
            boolean AM=false;
        
            switch(SoftVersion & 0xFF)
            {
            case 0x00:
                    NumofFreq=63;
                    Freq=902.6;
                    jumpFreq=0.4;
                    break;
            case 0x01:
                    NumofFreq=125;
                    Freq=902.6;
                    jumpFreq=0.2;
                    break;
            case 0x02:
                    NumofFreq=11;
                    Freq=865.5;
                    jumpFreq=0.2;
                    break;
            case 0x03:
                    NumofFreq=8;
                    Freq=902.6;
                    jumpFreq=3.6;
                    break;
            case 0x04:
                    NumofFreq=10;
                    Freq=952.2;
                    jumpFreq=0.2;
                    break;
            case 0x05:
                    NumofFreq=42;
                    Freq=919.2;
                    jumpFreq=0.2;
                    break;
            case 0x06:
                    NumofFreq=16;
                    Freq=920.625;
                    jumpFreq=0.25;
                    ischina=true;
                    break;
           //韩国
            case 0x07:
                    NumofFreq=16;
                    Freq=910.5;
                    jumpFreq=0.2;
                    break;
            case 0x08:
                    NumofFreq=50;
                    Freq=902.75;
                    jumpFreq=0.5;
                    AM=true;
                    break;
            case 0x09:
                    NumofFreq=16;
                    Freq=840.625;
                    jumpFreq=0.25;
                    ischina=true;
                    break;
            default:
                    NumofFreq=63;
                    Freq=902.6;
                    jumpFreq=0.4;
            }

            for(i=0; i<NumofFreq; i++)
            {

                    if (ischina)
                    {
                            str_temp = String.format("%d:%7.3f",i+1, Freq+i*jumpFreq);

                    }
                    else
                    {
                            if(AM==true)
                            {
                                    str_temp = String.format("%d:%5.2f",i+1, Freq+i*jumpFreq);
                            }
                            else
                            {
                                    str_temp = String.format("%d:%5.1f",i+1, Freq+i*jumpFreq);
                            }

                    }
                    jComboBox9.addItem(str_temp);
                    jComboBox10.addItem(str_temp);
                    
            }
            
            jComboBox9.setSelectedIndex(gHandParam[0].Min_Frequence-1);
            jComboBox10.setSelectedIndex(gHandParam[0].Max_Frequence-1);
            
            str_temp = String.format("%02d%02d",(SoftVersion>>8) & 0xFF,SoftVersion & 0xFF);
            jTextField27.setText(""+str_temp);
            str_temp = String.format("%02d%02d",(HardVersion>>8) & 0xFF,HardVersion & 0xFF);
            jTextField28.setText(""+str_temp);
            
            
            //发射功率
            int m_Power=gHandParam[0].Power;
	    jTextField29.setText(""+m_Power);
            
            
            
            //模块类型,0---R2000, 1---VM5E											(19)
            int m_Modutype=gHandParam[0].Modutype;
            jTextField30.setText(""+m_Modutype);           
        
            //////////////////////////////////////////////////////////////////
            
    }//GEN-LAST:event_jButton16ActionPerformed

    private void jButton17ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton17ActionPerformed
        // TODO add your handling code here:
        //Write Param
        //下面
        //////////////////////////////////////////////////////////////////
        //buzzer
        String str_temp;
        //波特率
        gHandParam[0].USBBaudRate = (byte)(jComboBox8.getSelectedIndex()+4);

        gHandParam[0].RFhrdVer1=HVer1; 
        gHandParam[0].RFhrdVer2=HVer2; 
        gHandParam[0].RFSoftVer1=SVer1; 
        gHandParam[0].RFSoftVer1=SVer1; 


        gHandParam[0].Min_Frequence = (byte)(jComboBox9.getSelectedIndex()+1);
        gHandParam[0].Max_Frequence = (byte)(jComboBox10.getSelectedIndex()+1);


        //发射功率
        str_temp = jTextField29.getText();
        gHandParam[0].Power = Byte.parseByte(str_temp);

        //模块类型,0---R2000, 1---VM5E											(19)
        
        //////////////////////////////////////////////////////////////////
        switch (ConnectMode){
        case 0://U口
            //USB
            res = ReaderAPI.WriteHanderParam(hScanner[0], gHandParam);
            break;
        case 1://串口
            //RS232
            res = ReaderAPI.WriteHanderParam(hScanner[0], gHandParam);

            break;
        }
        if(res == READERDLL._OK)
	{
		
		JOptionPane.showMessageDialog(this, "Param successfully!", "Notice", JOptionPane.INFORMATION_MESSAGE);
	}
	else
	{
		
		JOptionPane.showMessageDialog(this, "fail to Param !!", "Warning", JOptionPane.ERROR_MESSAGE);
	}
        
    }//GEN-LAST:event_jButton17ActionPerformed

    private void connectButtonFunc() {
        ConnectMode =   -1;////连接的模式,0---网口，1---RS232，2---RS485
        if ( jRadioButton1.isSelected() ){
	// 选项了TCP/IP,Usb
            ConnectMode =   0;

        }else if ( jRadioButton2.isSelected() ) {
        //串口
            ConnectMode =   1;
        }else {
            return;
        }

        int i = 0;
        //int[] nBaudRate = new int[1];
        int nBaudRate = 0;
        //ReaderAPI.writeLog("", " Starting... ");
        String strHostIp;//host ip
        String strReaderIp;//Readerip
        String strTemp;
        String strComm;

        strHostIp   =   jTextField3.getText();//Host IP
        strTemp     =   jTextField4.getText();//host port
        m_HostPort  =   Integer.parseInt(strTemp);

        strReaderIp   =   jTextField1.getText();//Reader IP
        strTemp     =   jTextField2.getText();//Reader port
        m_Port  =   Integer.parseInt(strTemp);

        strComm = jComboBox_ports.getSelectedItem().toString();

        //输入参数:	lOpt 为何种方式通信(0--TCP/IP, 1--RS232,2--RS485, 3--USB)
	long lopt = 0;
        
        switch (ConnectMode){
            case 0://U口
                lopt	=	3;//USB
                //iRet = ReaderAPI.Net_ConnectScanner(hScanner, "192.168.0.103", 1969, "192.168.0.71", 5555);
                //res = ReaderAPI.Net_ConnectScanner(hScanner, strReaderIp, m_Port, strHostIp, m_HostPort);
                res = ReaderAPI.VH_ConnectScannerUsb(hScanner);
                break;
            case 1://串口
                lopt	=	1;//RS232
                //res = ReaderAPI.ConnectScanner(hScanner, "COM7", nBaudRate);
                res = ReaderAPI.ConnectScanner(hScanner, strComm, nBaudRate);
                break;
        }
        if (res==ReaderAPI._OK)
        {
            //将通信方式存起来
	    ReaderAPI.VH_SetCommunicationOpt(lopt, null);
                    
            //连上了，选择哪个模式通迅变恢
            short[] HandVer = new short[1];
            short[] SoftVer = new short[1];

            for (i = 0; i < 5; i++)
            {
                //取哪个版本
                switch(ConnectMode)
                {
                case 0://U口
                    res = ReaderAPI.VH_GetVersion(hScanner[0], HandVer, SoftVer);
                        break;
                case 1://RS232
                    res = ReaderAPI.VH_GetVersion(hScanner[0], HandVer, SoftVer);
                        break;

                }

                if ( res == READERDLL._OK )
                {
                        break;
                }

            }
            if (res!=READERDLL._OK)
            {
                    //MessageBox("Connect Reader Fail!(Version)","Warning",MB_ICONWARNING);
                    JOptionPane.showMessageDialog(this, "Connect Reader Fail!(Version)", "Warning", JOptionPane.ERROR_MESSAGE);
                    //调关闭
                    return;
            }
        
        
            //HandsetParam gHandParam[] = new HandsetParam[1];//上上面有定义
            for (i = 0; i < 3; i++)
            {
                switch(ConnectMode)
                {
                case 0://U口
                    res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                        break;
                case 1://RS232
                    res = ReaderAPI.ReadHanderParam(hScanner[0], gHandParam);
                        break;

                }

                if ( res == ReaderAPI._OK )
                {
                        break;
                }
            }
            if (res!=ReaderAPI._OK)
            {
                    //MessageBox("Connect Reader Fail!(ReadHanderParam)","Warning",MB_ICONWARNING);
                    JOptionPane.showMessageDialog(this, "Connect Reader Fail!(ReadHanderParam)", "Warning", JOptionPane.ERROR_MESSAGE);
                    //调关闭
                    return;
            }

            byte bMode = 0;
            switch(ConnectMode)
            {
            case 0://网口
                bMode = 1;
                res = ReaderAPI.SetReaderMode(hScanner[0], bMode);//设置手机进入读写器模式，即模块电源打开，1--打开，0--关闭
                    break;
            case 1://RS232
                bMode = 1;
                res = ReaderAPI.SetReaderMode(hScanner[0], bMode);//设置手机进入读写器模式，即模块电源打开，1--打开，0--关闭
                    break;

            }
            if (res!=ReaderAPI._OK)
            {
                    //MessageBox("SetAntenna Fail!Please try again!","Warning",MB_ICONWARNING);
                    JOptionPane.showMessageDialog(this, "Set Mode Reader Fail!Please try again!", "Warning", JOptionPane.ERROR_MESSAGE);
                    return;
            }
        
            
            
            ifConnectReader=1;
            NewConnect=1;

            // 连接按钮和断开按钮
            jButton_connect.setEnabled(false);
            jButton_disconnect.setEnabled(true);

            //MessageBox("Connect Reader Success!","Notice",MB_ICONINFORMATION);
            JOptionPane.showMessageDialog(this, "Connect Reader Success!", "Notice", JOptionPane.INFORMATION_MESSAGE);
            //jTabbedPane.setSelectedComponent(jPanel_ISO18000_6C);
            jTabbedPane.setSelectedComponent(jPanel_ReaderParam);
            //更新外购状态
            UpdateStatus();

            //////////////////////////////////////////////////////////////////
            String str_temp;
            //buzzer
            int m_Alarm=gHandParam[0].Alarm & 0x01;
            if ( 1 == m_Alarm )
            {
                jCheckBox9.setSelected(true);
            }
            else
            {
                jCheckBox9.setSelected(false);
            }
            
            //名单
            int m_IsLable=(gHandParam[0].Alarm>>1)&0x01;
            if ( 1 == m_Alarm )
            {
                jCheckBox8.setSelected(true);
            }
            else
            {
                jCheckBox8.setSelected(false);
            }
            
            //标签类型
            if(gHandParam[0].TagType==0x01)
            {
                jRadioButton24.setSelected(true);//6B
            }
            else
            {
                jRadioButton24.setSelected(false);//6B
            }
            if(gHandParam[0].TagType==0x04)
            {
                jRadioButton25.setSelected(true);//6C
            }
            else
            {
                jRadioButton25.setSelected(false);//6C                
            }
            
            //输出方式
            int m_OutputType = gHandParam[0].OutputMode;
            if(m_OutputType==0x00)
            {
                jRadioButton26.setSelected(true);//Save and Output
            }
            if(m_OutputType==0x01)
            {
                jRadioButton27.setSelected(true);//Save 
            }
            if(m_OutputType==0x02)
            {
                jRadioButton28.setSelected(true);//Output
            }
            
            //波特玄
            jComboBox8.setSelectedIndex(gHandParam[0].USBBaudRate-4);
            //发射功率
            int m_Power=gHandParam[0].Power;
	    jTextField29.setText(""+m_Power);
        
            int m_IsTID=gHandParam[0].ISTID;//是否是TID区
            if ( 1 == m_IsTID )
            {
                jCheckBox5.setSelected(true);
            }
            else
            {
                jCheckBox5.setSelected(false);
            }
	
            int m_TIDAddr=gHandParam[0].TIDAddr;//TID读取位置
            jTextField19.setText(""+m_TIDAddr);


            int m_TIDLen=gHandParam[0].TIDLen;//TID读取长度
            jTextField20.setText(""+m_TIDLen);


            int m_IsUSER=gHandParam[0].ISUSER;//是否是User区
            if ( 1 == m_IsUSER )
            {
                jCheckBox6.setSelected(true);
            }
            else
            {
                jCheckBox6.setSelected(false);
            }


            int m_USERAdder=gHandParam[0].USERAddr;//User读取位置
            jTextField21.setText(""+m_USERAdder);


            int m_USERLen=gHandParam[0].USERLen;//User读取长度
            jTextField22.setText(""+m_USERLen);


            //ISVibrate;		//电机振动,0-不，1-振动													(18)
            int m_IsVibrate=gHandParam[0].ISVibrate;
            if ( 1 == m_IsVibrate )
            {
                jCheckBox7.setSelected(true);
            }
            else
            {
                jCheckBox7.setSelected(false);
            }
        
            
            HVer1=gHandParam[0].RFhrdVer1;
	    HVer2=gHandParam[0].RFhrdVer2;
	    SVer1=gHandParam[0].RFSoftVer1;
	    SVer2=gHandParam[0].RFSoftVer2;
            int SoftVersion=gHandParam[0].RFSoftVer1*0x100+gHandParam[0].RFSoftVer2;
            int HardVersion=gHandParam[0].RFhrdVer1*0x100+gHandParam[0].RFhrdVer2;
            str_temp = String.format("%02d%02d",(SoftVersion>>8) & 0xFF,SoftVersion & 0xFF);
            jTextField27.setText(""+str_temp);
            str_temp = String.format("%02d%02d",(HardVersion>>8) & 0xFF,HardVersion & 0xFF);
            jTextField28.setText(""+str_temp);
                      
        
            jComboBox9.removeAllItems();
            jComboBox9.setEditable(false);
            jComboBox10.removeAllItems();
            jComboBox10.setEditable(false);
                        
            
            int NumofFreq;
            double Freq,jumpFreq;
            boolean ischina=false;
            boolean AM=false;
        
            switch(SoftVersion & 0xFF)
            {
            case 0x00:
                    NumofFreq=63;
                    Freq=902.6;
                    jumpFreq=0.4;
                    break;
            case 0x01:
                    NumofFreq=125;
                    Freq=902.6;
                    jumpFreq=0.2;
                    break;
            case 0x02:
                    NumofFreq=11;
                    Freq=865.5;
                    jumpFreq=0.2;
                    break;
            case 0x03:
                    NumofFreq=8;
                    Freq=902.6;
                    jumpFreq=3.6;
                    break;
            case 0x04:
                    NumofFreq=10;
                    Freq=952.2;
                    jumpFreq=0.2;
                    break;
            case 0x05:
                    NumofFreq=42;
                    Freq=919.2;
                    jumpFreq=0.2;
                    break;
            case 0x06:
                    NumofFreq=16;
                    Freq=920.625;
                    jumpFreq=0.25;
                    ischina=true;
                    break;
           //韩国
            case 0x07:
                    NumofFreq=16;
                    Freq=910.5;
                    jumpFreq=0.2;
                    break;
            case 0x08:
                    NumofFreq=50;
                    Freq=902.75;
                    jumpFreq=0.5;
                    AM=true;
                    break;
            case 0x09:
                    NumofFreq=16;
                    Freq=840.625;
                    jumpFreq=0.25;
                    ischina=true;
                    break;
            default:
                    NumofFreq=63;
                    Freq=902.6;
                    jumpFreq=0.4;
            }

            for(i=0; i<NumofFreq; i++)
            {

                    if (ischina)
                    {
                            str_temp = String.format("%d:%7.3f",i+1, Freq+i*jumpFreq);

                    }
                    else
                    {
                            if(AM==true)
                            {
                                    str_temp = String.format("%d:%5.2f",i+1, Freq+i*jumpFreq);
                            }
                            else
                            {
                                    str_temp = String.format("%d:%5.1f",i+1, Freq+i*jumpFreq);
                            }

                    }
                    jComboBox9.addItem(str_temp);
                    jComboBox10.addItem(str_temp);
                    
            }
            
            jComboBox9.setSelectedIndex(gHandParam[0].Min_Frequence-1);
            jComboBox10.setSelectedIndex(gHandParam[0].Max_Frequence-1);
            
            //模块类型,0---R2000, 1---VM5E											(19)
            int m_Modutype=gHandParam[0].Modutype;
            jTextField30.setText(""+m_Modutype);
        
            //////////////////////////////////////////////////////////////////
            

        }else {
            //连接失败
            JOptionPane.showMessageDialog(this, "Connect Reader Fail!", "Warning", JOptionPane.ERROR_MESSAGE);

        }



    }
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Windows".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(JDialogDemo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(JDialogDemo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(JDialogDemo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(JDialogDemo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>



        /*
         * Create and display the dialog
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                int i = 0;
                //JDialogDemo dialog = new JDialogDemo(new javax.swing.JFrame(), true);
                dialog = new JDialogDemo(new javax.swing.JFrame(), true);
                dialog.buttonGroup1.add (dialog.jRadioButton1);
                dialog.buttonGroup1.add (dialog.jRadioButton2);
                dialog.jRadioButton1.setSelected(true);

		// 连接按钮和断开按钮
		dialog.jButton_connect.setEnabled(true);
                dialog.jButton_disconnect.setEnabled(false);





		// 设置窗体大小
                //int windowsWedth = 600;
                //int windowsHeight = 600;

				// 得到显示器屏幕的宽高
                //int width = Toolkit.getDefaultToolkit().getScreenSize().width;
                //int height = Toolkit.getDefaultToolkit().getScreenSize().height;






                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });

				// 获得屏幕大小
                Dimension s = Toolkit.getDefaultToolkit().getScreenSize();
				// 获得窗体大小
                Dimension d = dialog.getSize();
				// 计算居中的位置
				dialog.setLocation((s.width - d.width) / 2,
						(s.height - d.height) / 2);

                dialog.setVisible(true);
            }


        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.ButtonGroup buttonGroup2;
    private javax.swing.ButtonGroup buttonGroup3;
    private javax.swing.ButtonGroup buttonGroup4;
    private javax.swing.ButtonGroup buttonGroup5;
    private javax.swing.ButtonGroup buttonGroup6;
    private javax.swing.ButtonGroup buttonGroup7;
    private javax.swing.ButtonGroup buttonGroup8;
    private javax.swing.ButtonGroup buttonGroup9;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton12;
    private javax.swing.JButton jButton13;
    private javax.swing.JButton jButton14;
    private javax.swing.JButton jButton15;
    private javax.swing.JButton jButton16;
    private javax.swing.JButton jButton17;
    private javax.swing.JButton jButton18;
    private javax.swing.JButton jButton19;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton20;
    private javax.swing.JButton jButton21;
    private javax.swing.JButton jButton22;
    private javax.swing.JButton jButton23;
    private javax.swing.JButton jButton24;
    private javax.swing.JButton jButton25;
    private javax.swing.JButton jButton26;
    private javax.swing.JButton jButton27;
    private javax.swing.JButton jButton28;
    private javax.swing.JButton jButton29;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton30;
    private javax.swing.JButton jButton31;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JButton jButton_connect;
    private javax.swing.JButton jButton_disconnect;
    private javax.swing.JCheckBox jCheckBox1;
    private javax.swing.JCheckBox jCheckBox10;
    private javax.swing.JCheckBox jCheckBox2;
    private javax.swing.JCheckBox jCheckBox3;
    private javax.swing.JCheckBox jCheckBox4;
    private javax.swing.JCheckBox jCheckBox5;
    private javax.swing.JCheckBox jCheckBox6;
    private javax.swing.JCheckBox jCheckBox7;
    private javax.swing.JCheckBox jCheckBox8;
    private javax.swing.JCheckBox jCheckBox9;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox10;
    private javax.swing.JComboBox jComboBox11;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    private javax.swing.JComboBox jComboBox5;
    private javax.swing.JComboBox jComboBox6;
    private javax.swing.JComboBox jComboBox7;
    private javax.swing.JComboBox jComboBox8;
    private javax.swing.JComboBox jComboBox9;
    private javax.swing.JComboBox jComboBox_ports;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel15;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel17;
    private javax.swing.JPanel jPanel18;
    private javax.swing.JPanel jPanel19;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel20;
    private javax.swing.JPanel jPanel21;
    private javax.swing.JPanel jPanel22;
    private javax.swing.JPanel jPanel23;
    private javax.swing.JPanel jPanel24;
    private javax.swing.JPanel jPanel25;
    private javax.swing.JPanel jPanel26;
    private javax.swing.JPanel jPanel27;
    private javax.swing.JPanel jPanel28;
    private javax.swing.JPanel jPanel29;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel30;
    private javax.swing.JPanel jPanel31;
    private javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel33;
    private javax.swing.JPanel jPanel34;
    private javax.swing.JPanel jPanel35;
    private javax.swing.JPanel jPanel36;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JPanel jPanel_BlueTooth;
    private javax.swing.JPanel jPanel_Data;
    private javax.swing.JPanel jPanel_ISO18000_6C;
    private javax.swing.JPanel jPanel_ReaderParam;
    private javax.swing.JPanel jPanel_connect;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JRadioButton jRadioButton1;
    private javax.swing.JRadioButton jRadioButton10;
    private javax.swing.JRadioButton jRadioButton11;
    private javax.swing.JRadioButton jRadioButton12;
    private javax.swing.JRadioButton jRadioButton13;
    private javax.swing.JRadioButton jRadioButton14;
    private javax.swing.JRadioButton jRadioButton15;
    private javax.swing.JRadioButton jRadioButton16;
    private javax.swing.JRadioButton jRadioButton17;
    private javax.swing.JRadioButton jRadioButton18;
    private javax.swing.JRadioButton jRadioButton19;
    private javax.swing.JRadioButton jRadioButton2;
    private javax.swing.JRadioButton jRadioButton20;
    private javax.swing.JRadioButton jRadioButton21;
    private javax.swing.JRadioButton jRadioButton22;
    private javax.swing.JRadioButton jRadioButton23;
    private javax.swing.JRadioButton jRadioButton24;
    private javax.swing.JRadioButton jRadioButton25;
    private javax.swing.JRadioButton jRadioButton26;
    private javax.swing.JRadioButton jRadioButton27;
    private javax.swing.JRadioButton jRadioButton28;
    private javax.swing.JRadioButton jRadioButton3;
    private javax.swing.JRadioButton jRadioButton4;
    private javax.swing.JRadioButton jRadioButton5;
    private javax.swing.JRadioButton jRadioButton6;
    private javax.swing.JRadioButton jRadioButton7;
    private javax.swing.JRadioButton jRadioButton8;
    private javax.swing.JRadioButton jRadioButton9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTextArea jTextArea1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField10;
    private javax.swing.JTextField jTextField11;
    private javax.swing.JTextField jTextField12;
    private javax.swing.JTextField jTextField13;
    private javax.swing.JTextField jTextField14;
    private javax.swing.JTextField jTextField15;
    private javax.swing.JTextField jTextField16;
    private javax.swing.JTextField jTextField17;
    private javax.swing.JTextField jTextField18;
    private javax.swing.JTextField jTextField19;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField20;
    private javax.swing.JTextField jTextField21;
    private javax.swing.JTextField jTextField22;
    private javax.swing.JTextField jTextField23;
    private javax.swing.JTextField jTextField24;
    private javax.swing.JTextField jTextField25;
    private javax.swing.JTextField jTextField26;
    private javax.swing.JTextField jTextField27;
    private javax.swing.JTextField jTextField28;
    private javax.swing.JTextField jTextField29;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField30;
    private javax.swing.JTextField jTextField31;
    private javax.swing.JTextField jTextField33;
    private javax.swing.JTextField jTextField34;
    private javax.swing.JTextField jTextField35;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTextField jTextField5;
    private javax.swing.JTextField jTextField6;
    private javax.swing.JTextField jTextField7;
    private javax.swing.JTextField jTextField8;
    private javax.swing.JTextField jTextField9;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JToggleButton jToggleButton2;
    private javax.swing.JToggleButton jToggleButton3;
    // End of variables declaration//GEN-END:variables
}
