@Override
	/*public void focusGained(FocusEvent evt) {
		if (evt.getSource() == dataPacketText) {
			dataPacketText.setText("");
		}	
	}

	@Override
	public void focusLost(FocusEvent evt) {
		// do nothing
	}*/

	public void actionPerformed(ActionEvent evt){
		
		if (evt.getSource() == connectBtn) {
			serialPortManager.connect();
			if (serialPortManager.getConnectionStatus() == true)
			{
				if (serialPortManager.initIOStream() == true)
				{
					serialPortManager.initListener();
				}
			}
			
			//logFile.WriteHeader();
			
		} else if (evt.getSource() == disconnectBtn) {
			resetTimePerCycle();
			serialPortManager.disconnect();
			//networkThread.interrupt();
			System.out.println(networkThread.getName() + " 's status is: " + networkThread.getState());
			
		} /*else if (evt.getSource() == dataPacketText) {
			logAreaText.append("Default packet value changed" + "\n");
			
		}*/ else if (evt.getSource() == sendBtn) {
			//timePerCycle++;
			//timeSlotValueLabel.setText(String.valueOf(timePerCycle));
					
			if (!networkThread.isAlive() && !networkThread.isInterrupted()) {
				networkThread.start();				
			}
 			//serialPortManager.sendData(0, 0, 0, 0);
			
		} else if (evt.getSource() == dataPacketButton) {
			String packetText = dataPacketButton.getText();
			StringTokenizer token = new StringTokenizer(packetText, ",");
			int botId 			= Integer.parseInt(token.nextToken());
			int parent 			= Integer.parseInt(token.nextToken());
			int timeSlot 		= Integer.parseInt(token.nextToken());
			int packetSubTree 	= Integer.parseInt(token.nextToken());
			
			serialPortManager.sendData(botId, parent, timeSlot, packetSubTree);
			System.out.println(networkThread.getName() + " 's status is: " + networkThread.getState());
		}
		
	}