messageReceivedWhileIconified = true;
} else {
setForceFocus();
}
DefaultStyledDocument doc = new DefaultStyledDocument();
int offset = 0;
try {
for (ReceivedChatMessage msg : formattedMessages) {
SimpleAttributeSet attrs = new SimpleAttributeSet();
ColorConstants.setForeground(attrs, msg.color);
String nick = msg.nickname;
String text = msg.ev.getText();
doc.insertString(offset, nick + ": ", attrs);
offset += nick.length() + 2;
doc.insertString(offset, text + "\n", null);
offset += text.length() + 1;
}
} catch (BadLocationException e) {
e.printStackTrace(); //should never happen
}