tabbedChatWindow.addChatTab(chatPanel);
if (tabbedChatWindow.getTabCount() > 1) {
tabbedChatWindow
.setSelectedContactTab(this.contactItem);
}
<BUG>if (tabbedChatWindow.isVisible())

tabbedChatWindow.toFront();
else</BUG>
tabbedChatWindow.setVisible(true);

tabbedChatWindow.addChatTab(chatPanel);
if (tabbedChatWindow.getTabCount() > 1) {
tabbedChatWindow
.setSelectedContactTab(this.contactItem);
}
if (tabbedChatWindow.isVisible()) {
if(tabbedChatWindow.getState() == JFrame.ICONIFIED)
tabbedChatWindow.setState(JFrame.NORMAL);
tabbedChatWindow.toFront();
}
else
tabbedChatWindow.setVisible(true);
