private void btn_applyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_applyActionPerformed
       
        String ip = Util.validIP(txt_ip.getText());
        String subnetmask = Util.validIP(txt_subnetmask.getText());
        String gateway = Util.validIP(txt_gateway.getText());
        String dns = Util.validIP(txt_dns.getText());
        if(ip==null){          
           JOptionPane.showMessageDialog(null,"You enter the IP address is invalid. ");
           txt_ip.setFocusable(true);
           return;
       }else{
            txt_ip.setText(ip);
        }
        
       if(subnetmask==null){          
           JOptionPane.showMessageDialog(null,"You enter the Subnet mask is invalid. ");
           txt_subnetmask.setFocusable(true);
           return;
       }else{
            txt_subnetmask.setText(subnetmask);
        }
       if(gateway==null){          
           JOptionPane.showMessageDialog(null,"You enter the Default gateway is invalid. ");
           txt_gateway.setFocusable(true);
           return;
       }else{
            txt_gateway.setText(gateway);
        }
       
        if(dns==null){          
           JOptionPane.showMessageDialog(null,"You enter the DNS server is invalid. ");
           txt_dns.setFocusable(true);
           return;
       }else{
            txt_dns.setText(dns);
        }
        
        
        
        try{
            List<MConfig> listConfig = MyETools.listConfig;
            MConfig currConfig = null;
            for(int i=0;i<listConfig.size();i++){
                if(listConfig.get(i).getIsSelect()==1){
                    currConfig = listConfig.get(i);
                }
            }
            if(currConfig == null){
                return;
            }
            //currConfig = getConfigInfo(currConfig);
            byte[] datas = currConfig.MConfigToByte(getConfigInfo(currConfig));
            datas[8] = 0x02;
            ByteBuffer buffer = ByteBuffer.wrap(datas);
            MyETools.channel.send(buffer, new InetSocketAddress("255.255.255.255",Constants.SEND_PORT));
        }catch (Exception ex) {
            Logger.getLogger(BroadcastUdp.class.getName()).log(Level.SEVERE, null, ex);
        }
        ProgressWin win = new ProgressWin();
        win.setVisible(true);
    }//GEN-LAST:event_btn_applyActionPerformed