public void addStringToChat(String user, int hour, int minute, int second,
			String toAdd) { // this method is public because we gonna use this
							// in main to add chat lines!
		if (user.equals("System")) {
			SimpleAttributeSet set = new SimpleAttributeSet();
			StyleConstants.setForeground(set, Color.red);
			StyleConstants.setBold(set, true);

			Document doc = new DefaultStyledDocument();

			try {

				doc.insertString(0, user + ": " + toAdd, set);
			} catch (BadLocationException e) {
				e.printStackTrace();
			}
			chatLines.setStyledDocument((StyledDocument) doc);
		} else if (isConnectedToServer) {
			SimpleAttributeSet set = new SimpleAttributeSet();
			if (user.equals("me")) {
				StyleConstants.setBold(set, true);
				// Set the attributes before adding text
				chatLines.setCharacterAttributes(set, true);
			} else {
				if (StyleConstants.isBold(set))
					StyleConstants.setBold(set, false);

				StyleConstants.setItalic(set, true);

				// Set the attributes before adding text
				chatLines.setCharacterAttributes(set, true);
			}
			Document doc = chatLines.getStyledDocument();

			try {
				doc.insertString(0, user + "[" + hour + ":" + minute + ":"
						+ second + "]: " + toAdd + "\n", set);
			} catch (BadLocationException e) {
				e.printStackTrace();
			}
		}

	}