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

        modeButtonGroup = new javax.swing.ButtonGroup();
        endianButtonGroup = new javax.swing.ButtonGroup();
        messageTablePopupMenu = new javax.swing.JPopupMenu();
        removeMessageMenuItem = new javax.swing.JMenuItem();
        logTextPanePopupMenu = new javax.swing.JPopupMenu();
        clearMenuItem = new javax.swing.JMenuItem();
        vneMessageTablePopupMenu = new javax.swing.JPopupMenu();
        removeVMEMessageMenuItem = new javax.swing.JMenuItem();
        vmeLogPopupMenu = new javax.swing.JPopupMenu();
        vmeClearMenuItem = new javax.swing.JMenuItem();
        commTabbedPane = new javax.swing.JTabbedPane();
        settingPanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        serverRadioButton = new javax.swing.JRadioButton();
        clientRadioButton = new javax.swing.JRadioButton();
        serverPanel = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        startServerButton = new javax.swing.JButton();
        stopServerButton = new javax.swing.JButton();
        portFormattedTextField = new javax.swing.JFormattedTextField();
        serverStatusTextField = new javax.swing.JTextField();
        clientPanel = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        connectButton = new javax.swing.JButton();
        disconnectButton = new javax.swing.JButton();
        clientStatusTextField = new javax.swing.JTextField();
        serverIpAdrsFormattedTextField = new javax.swing.JFormattedTextField();
        serverPortFormattedTextField = new javax.swing.JFormattedTextField();
        messagePanel = new javax.swing.JPanel();
        messageScrollPane = new javax.swing.JScrollPane();
        messageTable = new javax.swing.JTable();
        endianPanel = new javax.swing.JPanel();
        bigEndianRadioButton = new javax.swing.JRadioButton();
        littleEndianRadioButton = new javax.swing.JRadioButton();
        statuPanel = new javax.swing.JPanel();
        statusTextField = new javax.swing.JTextField();
        fileInfoPanel = new javax.swing.JPanel();
        fileInfoTextField = new javax.swing.JTextField();
        logPanel = new javax.swing.JPanel();
        logScrollPane = new javax.swing.JScrollPane();
        logTextPane = new javax.swing.JTextPane();
        vmeMessagePanel = new javax.swing.JPanel();
        statusPanel = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        fileNameTextField = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        updateStatusTextField = new javax.swing.JTextField();
        vmeMsgPanel = new javax.swing.JPanel();
        vmeMsgScrollPane = new javax.swing.JScrollPane();
        vmeMsgTable = new javax.swing.JTable();
        vmeLogPanel = new javax.swing.JPanel();
        vmeLogScrollPane = new javax.swing.JScrollPane();
        vmeLogTextPane = new javax.swing.JTextPane();
        creationPanel = new javax.swing.JPanel();
        creationScrollPane = new javax.swing.JScrollPane();
        creationTable = new javax.swing.JTable();
        creationTable.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
        creationTable.getActionMap().put("Enter", new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                int row = creationTable.getSelectedRow();
                int count = creationTable.getRowCount();
                if(row == count-1) {
                    int val = (Integer)creationTable.getValueAt(row, 0);
                    DefaultTableModel model = (DefaultTableModel)creationTable.getModel();
                    model.addRow(new Object[]{new Integer(val+1), "msg"+(val+1), "0", new Integer(0)});
                    creationTable.changeSelection(row+1, 1, false, false);
                } else {
                    creationTable.changeSelection(row+1, 1, false, false);
                }
            }
        });
        msgCreationButton = new javax.swing.JButton();
        msgLoadButton = new javax.swing.JButton();
        jMenuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMessageSetMenuItem = new javax.swing.JMenuItem();
        saveMessageSetMenuItem = new javax.swing.JMenuItem();
        openVMEMsgMenuItem = new javax.swing.JMenuItem();
        saveVMEMsgMenuItem = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();

        removeMessageMenuItem.setText("remove message");
        removeMessageMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeMessageMenuItemActionPerformed(evt);
            }
        });
        messageTablePopupMenu.add(removeMessageMenuItem);

        clearMenuItem.setText("clear text");
        clearMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                clearMenuItemActionPerformed(evt);
            }
        });
        logTextPanePopupMenu.add(clearMenuItem);

        removeVMEMessageMenuItem.setText("remove message");
        removeVMEMessageMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeVMEMessageMenuItemActionPerformed(evt);
            }
        });
        vneMessageTablePopupMenu.add(removeVMEMessageMenuItem);

        vmeClearMenuItem.setText("clear text");
        vmeClearMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                vmeClearMenuItemActionPerformed(evt);
            }
        });
        vmeLogPopupMenu.add(vmeClearMenuItem);

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        commTabbedPane.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                int index = commTabbedPane.getSelectedIndex();
                if(index == 2) {
                    GlobalStatus.setOrder(ByteOrder.BIG_ENDIAN);
                    System.out.println(GlobalStatus.getOrder());
                } else {
                    if(bigEndianRadioButton.isSelected()) {
                        GlobalStatus.setOrder(ByteOrder.BIG_ENDIAN);
                    } else {
                        GlobalStatus.setOrder(ByteOrder.LITTLE_ENDIAN);
                    }
                }
            }
        });

        jLabel1.setText("TCP/IP Mode");

        modeButtonGroup.add(serverRadioButton);
        serverRadioButton.setText("Server");
        serverRadioButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        modeButtonGroup.add(clientRadioButton);
        clientRadioButton.setSelected(true);
        clientRadioButton.setText("Client");

        serverPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("For Server"));

        jLabel4.setText("Port");

        startServerButton.setText("Server Start");
        startServerButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                startServerButtonActionPerformed(evt);
            }
        });

        stopServerButton.setText("Server Stop");
        stopServerButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                stopServerButtonActionPerformed(evt);
            }
        });

        portFormattedTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("###0"))));
        portFormattedTextField.setText("10001");

        serverStatusTextField.setEditable(false);

        javax.swing.GroupLayout serverPanelLayout = new javax.swing.GroupLayout(serverPanel);
        serverPanel.setLayout(serverPanelLayout);
        serverPanelLayout.setHorizontalGroup(
            serverPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(serverPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(serverPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(serverStatusTextField)
                    .addGroup(serverPanelLayout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(portFormattedTextField))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, serverPanelLayout.createSequentialGroup()
                        .addGap(0, 293, Short.MAX_VALUE)
                        .addComponent(startServerButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(stopServerButton)))
                .addContainerGap())
        );
        serverPanelLayout.setVerticalGroup(
            serverPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(serverPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(serverPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(portFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(serverPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(stopServerButton)
                    .addComponent(startServerButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(serverStatusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        clientPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("For Client"));

        jLabel2.setText("Server IP Adrs");

        jLabel3.setText("Server Port");

        connectButton.setText("Connect");
        connectButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                connectButtonActionPerformed(evt);
            }
        });

        disconnectButton.setText("Disconnect");
        disconnectButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                disconnectButtonActionPerformed(evt);
            }
        });

        clientStatusTextField.setEditable(false);

        try {
            serverIpAdrsFormattedTextField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("###.###.###.###")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        serverIpAdrsFormattedTextField.setText("127.000.000.001");

        serverPortFormattedTextField.setText("10001");

        javax.swing.GroupLayout clientPanelLayout = new javax.swing.GroupLayout(clientPanel);
        clientPanel.setLayout(clientPanelLayout);
        clientPanelLayout.setHorizontalGroup(
            clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(clientPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(clientStatusTextField)
                    .addGroup(clientPanelLayout.createSequentialGroup()
                        .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel2)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, 111, Short.MAX_VALUE)
                        .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(serverIpAdrsFormattedTextField)
                            .addComponent(serverPortFormattedTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, clientPanelLayout.createSequentialGroup()
                        .addGap(0, 318, Short.MAX_VALUE)
                        .addComponent(connectButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(disconnectButton)))
                .addContainerGap())
        );
        clientPanelLayout.setVerticalGroup(
            clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(clientPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel2)
                    .addComponent(serverIpAdrsFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(serverPortFormattedTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(clientPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(connectButton)
                    .addComponent(disconnectButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE)
                .addComponent(clientStatusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        javax.swing.GroupLayout settingPanelLayout = new javax.swing.GroupLayout(settingPanel);
        settingPanel.setLayout(settingPanelLayout);
        settingPanelLayout.setHorizontalGroup(
            settingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(settingPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(settingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(settingPanelLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(18, 18, 18)
                        .addComponent(serverRadioButton)
                        .addGap(18, 18, 18)
                        .addComponent(clientRadioButton)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(settingPanelLayout.createSequentialGroup()
                        .addComponent(serverPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(clientPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        settingPanelLayout.setVerticalGroup(
            settingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(settingPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(settingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(serverRadioButton)
                    .addComponent(clientRadioButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(settingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(clientPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(serverPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(615, Short.MAX_VALUE))
        );

        commTabbedPane.addTab("Setting", settingPanel);

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

        MessageSetModel model = new MessageSetModel(4, connected);
        model.addTableModelListener(this);
        messageTable.setModel(model);
        messageTable.setComponentPopupMenu(messageTablePopupMenu);
        messageTable.setRowHeight(25);
        messageTable.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
        messageTable.getActionMap().put("Enter", new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if(messageTable.getEditingRow() == -1) {
                    int row = messageTable.getSelectedRow();
                    int count = messageTable.getRowCount();
                    if(row == count-1) {
                        MessageSetModel model = (MessageSetModel)messageTable.getModel();
                        model.addRow();
                        messageTable.changeSelection(row+1, 1, false, false);
                    } else {
                        messageTable.changeSelection(row+1, 1, false, false);
                    }
                }
            }
        });
        messageScrollPane.setViewportView(messageTable);
        messageTable.getColumnModel().getColumn(2).setCellEditor(new OpcodeEditor());
        messageTable.getColumnModel().getColumn(2).setCellRenderer(new HexRenderer());
        messageTable.getColumnModel().getColumn(6).setCellEditor(new ButtonRenderer());
        messageTable.getColumnModel().getColumn(6).setCellRenderer(new ButtonRenderer());

        endianPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("ByteOrder"));

        endianButtonGroup.add(bigEndianRadioButton);
        bigEndianRadioButton.setSelected(true);
        bigEndianRadioButton.setText("BigEndian");
        bigEndianRadioButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bigEndianRadioButtonActionPerformed(evt);
            }
        });

        endianButtonGroup.add(littleEndianRadioButton);
        littleEndianRadioButton.setText("LittleEndian");
        littleEndianRadioButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                littleEndianRadioButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout endianPanelLayout = new javax.swing.GroupLayout(endianPanel);
        endianPanel.setLayout(endianPanelLayout);
        endianPanelLayout.setHorizontalGroup(
            endianPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(endianPanelLayout.createSequentialGroup()
                .addComponent(bigEndianRadioButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(littleEndianRadioButton))
        );
        endianPanelLayout.setVerticalGroup(
            endianPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(endianPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(bigEndianRadioButton)
                .addComponent(littleEndianRadioButton))
        );

        statuPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Status"));
        statuPanel.setToolTipText("");

        statusTextField.setEditable(false);

        javax.swing.GroupLayout statuPanelLayout = new javax.swing.GroupLayout(statuPanel);
        statuPanel.setLayout(statuPanelLayout);
        statuPanelLayout.setHorizontalGroup(
            statuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statuPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(statusTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
                .addContainerGap())
        );
        statuPanelLayout.setVerticalGroup(
            statuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, statuPanelLayout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addComponent(statusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        fileInfoPanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Opend File Name"));

        fileInfoTextField.setEditable(false);

        javax.swing.GroupLayout fileInfoPanelLayout = new javax.swing.GroupLayout(fileInfoPanel);
        fileInfoPanel.setLayout(fileInfoPanelLayout);
        fileInfoPanelLayout.setHorizontalGroup(
            fileInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fileInfoPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(fileInfoTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 602, Short.MAX_VALUE))
        );
        fileInfoPanelLayout.setVerticalGroup(
            fileInfoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fileInfoPanelLayout.createSequentialGroup()
                .addComponent(fileInfoTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );

        logScrollPane.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
        logScrollPane.setAutoscrolls(true);

        logTextPane.setComponentPopupMenu(logTextPanePopupMenu);
        logScrollPane.setViewportView(logTextPane);

        javax.swing.GroupLayout logPanelLayout = new javax.swing.GroupLayout(logPanel);
        logPanel.setLayout(logPanelLayout);
        logPanelLayout.setHorizontalGroup(
            logPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(logScrollPane)
        );
        logPanelLayout.setVerticalGroup(
            logPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(logScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 329, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout messagePanelLayout = new javax.swing.GroupLayout(messagePanel);
        messagePanel.setLayout(messagePanelLayout);
        messagePanelLayout.setHorizontalGroup(
            messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(messagePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(fileInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(endianPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(statuPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
            .addComponent(messageScrollPane, javax.swing.GroupLayout.Alignment.TRAILING)
            .addComponent(logPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        messagePanelLayout.setVerticalGroup(
            messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, messagePanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(messagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(statuPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(endianPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(fileInfoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(messageScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 426, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(logPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        commTabbedPane.addTab("Message", messagePanel);

        statusPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Status", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.blue));

        jLabel5.setText("Opened FileName");

        fileNameTextField.setEditable(false);

        jLabel6.setText("Update Status");

        updateStatusTextField.setEditable(false);

        javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
        statusPanel.setLayout(statusPanelLayout);
        statusPanelLayout.setHorizontalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 646, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel6)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(updateStatusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        statusPanelLayout.setVerticalGroup(
            statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(statusPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(statusPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(fileNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel6)
                    .addComponent(updateStatusTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        vmeMsgPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "VME Message", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.blue));

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

        VMEMessageSetModel vmeModel = new VMEMessageSetModel(4, connected);
        vmeModel.addTableModelListener(this);
        vmeMsgTable.setModel(vmeModel);
        vmeMsgTable.setComponentPopupMenu(vneMessageTablePopupMenu);
        vmeMsgTable.setRowHeight(25);
        vmeMsgTable.getInputMap(JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "Enter");
        vmeMsgTable.getActionMap().put("Enter", new AbstractAction() {
            @Override
            public void actionPerformed(ActionEvent ae) {
                if(vmeMsgTable.getEditingRow() == -1) {
                    int row = vmeMsgTable.getSelectedRow();
                    int count = vmeMsgTable.getRowCount();
                    if(row == count-1) {
                        VMEMessageSetModel model = (VMEMessageSetModel)vmeMsgTable.getModel();
                        model.addRow();
                        vmeMsgTable.changeSelection(row+1, 1, false, false);
                    } else {
                        vmeMsgTable.changeSelection(row+1, 1, false, false);
                    }
                }
            }
        });
        vmeMsgScrollPane.setViewportView(vmeMsgTable);
        JComboBox combo = new JComboBox();
        combo.addItem("VME Read");
        combo.addItem("VME Write");
        vmeMsgTable.getColumnModel().getColumn(1).setCellEditor(new DefaultCellEditor(combo));
        vmeMsgTable.getColumnModel().getColumn(2).setCellEditor(new OpcodeEditor());
        vmeMsgTable.getColumnModel().getColumn(2).setCellRenderer(new HexRenderer());
        vmeMsgTable.getColumnModel().getColumn(4).setCellEditor(new OpcodeEditor());
        vmeMsgTable.getColumnModel().getColumn(4).setCellRenderer(new HexRenderer());
        vmeMsgTable.getColumnModel().getColumn(5).setCellEditor(new OpcodeEditor());
        vmeMsgTable.getColumnModel().getColumn(5).setCellRenderer(new HexRenderer());
        vmeMsgTable.getColumnModel().getColumn(6).setCellEditor(new ButtonRenderer());
        vmeMsgTable.getColumnModel().getColumn(6).setCellRenderer(new ButtonRenderer());

        javax.swing.GroupLayout vmeMsgPanelLayout = new javax.swing.GroupLayout(vmeMsgPanel);
        vmeMsgPanel.setLayout(vmeMsgPanelLayout);
        vmeMsgPanelLayout.setHorizontalGroup(
            vmeMsgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(vmeMsgScrollPane)
        );
        vmeMsgPanelLayout.setVerticalGroup(
            vmeMsgPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(vmeMsgScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 459, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        vmeLogPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "LOG", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, java.awt.Color.blue));

        vmeLogTextPane.setComponentPopupMenu(vmeLogPopupMenu);
        vmeLogScrollPane.setViewportView(vmeLogTextPane);

        javax.swing.GroupLayout vmeLogPanelLayout = new javax.swing.GroupLayout(vmeLogPanel);
        vmeLogPanel.setLayout(vmeLogPanelLayout);
        vmeLogPanelLayout.setHorizontalGroup(
            vmeLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(vmeLogScrollPane)
        );
        vmeLogPanelLayout.setVerticalGroup(
            vmeLogPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(vmeLogScrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 240, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout vmeMessagePanelLayout = new javax.swing.GroupLayout(vmeMessagePanel);
        vmeMessagePanel.setLayout(vmeMessagePanelLayout);
        vmeMessagePanelLayout.setHorizontalGroup(
            vmeMessagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(statusPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(vmeMsgPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(vmeLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        vmeMessagePanelLayout.setVerticalGroup(
            vmeMessagePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(vmeMessagePanelLayout.createSequentialGroup()
                .addComponent(statusPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(vmeMsgPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(vmeLogPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        commTabbedPane.addTab("VME Message", vmeMessagePanel);

        creationTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                { new Integer(1), "msg1", "0",  new Integer(0), null}
            },
            new String [] {
                "No", "메시지 명", "Opcode", "DataSize", "DefaultData"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.String.class, java.lang.String.class, java.lang.Integer.class, java.lang.Object.class
            };
            boolean[] canEdit = new boolean [] {
                false, true, true, true, true
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        creationScrollPane.setViewportView(creationTable);

        msgCreationButton.setText("Message Creation");
        msgCreationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                msgCreationButtonActionPerformed(evt);
            }
        });

        msgLoadButton.setText("Message Load");
        msgLoadButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                msgLoadButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout creationPanelLayout = new javax.swing.GroupLayout(creationPanel);
        creationPanel.setLayout(creationPanelLayout);
        creationPanelLayout.setHorizontalGroup(
            creationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, creationPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(msgLoadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(msgCreationButton)
                .addContainerGap())
            .addComponent(creationScrollPane, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1108, Short.MAX_VALUE)
        );
        creationPanelLayout.setVerticalGroup(
            creationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(creationPanelLayout.createSequentialGroup()
                .addComponent(creationScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 479, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(creationPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(msgCreationButton)
                    .addComponent(msgLoadButton))
                .addGap(0, 312, Short.MAX_VALUE))
        );

        commTabbedPane.addTab("IF-THEN Rule", creationPanel);

        fileMenu.setText("File");

        openMessageSetMenuItem.setText("Open Message Set");
        openMessageSetMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openMessageSetMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(openMessageSetMenuItem);

        saveMessageSetMenuItem.setText("Save Message Set");
        saveMessageSetMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveMessageSetMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(saveMessageSetMenuItem);

        openVMEMsgMenuItem.setText("Open VME Message Set");
        openVMEMsgMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                openVMEMsgMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(openVMEMsgMenuItem);

        saveVMEMsgMenuItem.setText("Save VME Message Set");
        saveVMEMsgMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveVMEMsgMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(saveVMEMsgMenuItem);

        jMenuBar.add(fileMenu);

        jMenu2.setText("Edit");
        jMenuBar.add(jMenu2);

        setJMenuBar(jMenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(commTabbedPane)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(commTabbedPane, javax.swing.GroupLayout.Alignment.TRAILING)
        );

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