private void jButtonConnectionActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jButtonConnectionActionPerformed
		logger.debug("click " + jButtonConnection.getText() + " button");
		if (timetask != null) {
			timetask.cancel();
		}

		Command.detectorIp = jTextFieldRemoteIP.getText();

		if (isConnection) {
			jButtonConnection.setText("Connection");
			isConnection = false;
			logger.info("disconnection from " + jTextFieldRemoteIP.getText());
			jTextFieldRemoteIP.setEditable(true);
			jLabelConnFlag.setForeground(new java.awt.Color(204, 51, 0));
			closePing();
			return;
		}

		if (!isConnection) {
			jTextFieldSSID.setText("");
			jTextFieldPassphrase.setText("");
			jButtonConnection.setText("Connect...");
			jButtonConnection.setEnabled(false);
			Command.localhostIp = jTextFieldLocalIP.getText();
			Command.broadcastIp = Command.localhostIp.substring(0,
					Command.localhostIp.lastIndexOf(".")) + ".255";

			logger.info("default host address:" + Command.localhostIp);
			logger.info("broadcast address:" + Command.broadcastIp);

			logger.info("try to connect " + jTextFieldRemoteIP.getText());
			isReachable(jTextFieldRemoteIP.getText());
		}

		timetask = new TimerTask() {

			@Override
			public void run() {
				logger.debug("check connection status.");
				try {
					if (isReachable) {
						if (!isConnection) {
							logger.info("connection successfully.");
							jLabelConnFlag.setForeground(new java.awt.Color(0,
									153, 51));
							jButtonConnection.setText("Disconnection");
							jTextFieldRemoteIP.setEditable(false);
							isConnection = true;

							/* start to run first command */
							Command command = Command.getInstance();
							if (command.commandHandshake()) {
								String macaddress = command
										.commandFullSignatureRequest();
								jTextFieldSSID.setText(macaddress);
								jTextFieldPassphrase.setText(Util
										.transferMacToNewString(macaddress));
							}
							;

						} else {

						}
					} else if (isConnection) {
						logger.info("connection failed.");
						jLabelConnFlag.setForeground(new java.awt.Color(204,
								51, 0));
						isConnection = false;
						jButtonConnection.setText("Connection");
						jTextFieldRemoteIP.setEditable(true);
						timetask.cancel();
						closePing();
					} else {
						logger.info("connection failed.");

						jButtonConnection.setText("Connection");
						jTextFieldRemoteIP.setEditable(true);
						timetask.cancel();
						closePing();
					}
					jButtonConnection.setEnabled(true);
				} catch (Exception ex) {
					logger.error(ex);
				}
			}
		};

		timer.schedule(timetask, 5000, 5000);

	}// GEN-LAST:event_jButtonConnectionActionPerformed