@Override
	public void actionPerformed(ActionEvent e) {
		
		if(e.getSource().equals(field)){
			String text = field.getText();
			if(text.startsWith("/")){
				//It's a command.
				String command = text.replace("/", "");
				String[] pieces = command.split(" ");
				switch(pieces[0].toLowerCase()){
				case "quit":
					WindowEvent wev = new WindowEvent(frame, WindowEvent.WINDOW_CLOSING);
					Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(wev);
					break;
				}
			}
			else {
				//It's text.
				s.sendServerMessage(text);
			}
			field.setText("");
		}
		
	}