public ChatComponent() {
		super();

		m_splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT);

		m_chatOutputArea = new JAutoscrollingTextArea();

		m_chatOutputArea
				.setText("Type a message and press ENTER to send\nYou can insert a new line by pressing the CTRL button and then X\n\n");

		m_chatInputArea = new JTextArea("");
		m_chatInputArea.setWrapStyleWord(true);
		m_chatInputArea.setLineWrap(true);
		m_chatInputArea.addKeyListener(new KeyListener() {

			public void keyPressed(KeyEvent e) {
				if ((e.isControlDown() && e.getKeyCode() == KeyEvent.VK_X)
						|| (e.isAltDown() && e.getKeyCode() == KeyEvent.VK_S)
						|| (e.isControlDown() && e.getKeyCode() == KeyEvent.VK_ENTER)
						|| (e.isAltDown() && e.getKeyCode() == KeyEvent.VK_ENTER)) {
					m_chatInputArea.append("\n");
					e.consume();
				} else if (e.getKeyCode() == KeyEvent.VK_ENTER) {
					actionPerformed(new ActionEvent(this, 0, ChatComponent.SEND));
					e.consume();
				}

			}

			public void keyReleased(KeyEvent e) {
				// TODO Auto-generated method stub

			}

			public void keyTyped(KeyEvent e) {

			}
		});

		m_chatSendButton = new JButton(IconChooser.getChatIcon());
		m_chatSendButton.setToolTipText("Send");
		m_chatSendButton.setActionCommand(ChatComponent.SEND);
		m_chatSendButton.addActionListener(this);

		m_chatInputPanel = new JPanel(new BorderLayout());
		m_chatInputAreaScrollPane = new JScrollPane(m_chatInputArea,
				JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
				JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
		m_chatInputPanel.add(m_chatSendButton, BorderLayout.EAST);
		m_chatInputPanel.add(m_chatInputAreaScrollPane, BorderLayout.CENTER);
		


		m_splitPane.setTopComponent(m_chatOutputArea);
		m_splitPane.setBottomComponent(m_chatInputPanel);

		setLayout(new BorderLayout());
		this.add(m_splitPane, BorderLayout.CENTER);

		setSize(400, 400);
		m_splitPane.setDividerLocation(300);
		

	}