private void okButton() {
		try {
			String SC = txtMAC.getText();
			if (!SC.matches("[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]:[0-9A-F][0-9A-F]")) {
				Error("Invalid MAC Address!");
				return;
			}
			
			if(txtSSID.getText().length() < 2){
				Error("Invalid SSID!");
			}
							
			NetworkLayerDevice tmpNode = (NetworkLayerDevice) Sim.getNode(NodeName);
			
			tmpNode.getConfig().executeCommand(
					"int " + NodeInt + " shutdown");
			
			tmpNode.getConfig().executeCommand(
					"int " + NodeInt + " mac-address " + SC);
			
			tmpNode.getConfig().executeCommand(
					"int " + NodeInt + " ssid " + txtSSID.getText());
			
			tmpNode.getConfig().executeCommand(
					"int " + NodeInt + " channel " + cmbChannel.getSelectedIndex());
			
			tmpNode.getConfig().executeCommand(
					"int " + NodeInt + " encryption key 1 size 40bit  " + txtWEPKey.getText());
			
			if(cmbAuthMode.getSelectedIndex() == 0)
				tmpNode.getConfig().executeCommand(
						"int " + NodeInt + " authentication open");
			else
				tmpNode.getConfig().executeCommand(
						"int " + NodeInt + " authentication shared");
			
			if(cmbMode.getSelectedItem().equals("Station")){
				tmpNode.getConfig().executeCommand(
						"int " + NodeInt + " station-role client");
			}
			else{
				tmpNode.getConfig().executeCommand(
						"int " + NodeInt + " station-role root access-point");
			}
			
			if (chkUP.isSelected()) {
				tmpNode.getConfig().executeCommand(
						"no int " + NodeInt + " shutdown");
			} else {
				tmpNode.getConfig().executeCommand(
						"int " + NodeInt + " shutdown");
			}
			tmpNode.getConfig().executeCommand("write mem");

				this.dispose();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}