/** * When a tab is highlighted sets an indicator of the number of unread messages in this tab. * * @param tabIndex the index of the tab * @param unreadMessageNumber the number of messages that the user hasn't yet read */ public void highlightTab(int tabIndex, int unreadMessageNumber) { Component c = this.getComponentAt(tabIndex); String tabTitle = ""; if (c instanceof ChatPanel) tabTitle = ((ChatPanel) c).getChatSession().getChatName(); else if (c instanceof CallPanel) tabTitle = ((CallPanel) c).getCallTitle(); if (unreadMessageNumber > 0) tabTitle = "(" + unreadMessageNumber + ") " + tabTitle; this.setTitleAt(tabIndex, tabTitle); super.highlightTab(tabIndex); }