setTitle();
setSessionTitle();
   private void nextSession() {      final int index = sessionPane.getSelectedIndex();      sessionPane.setForegroundAt(index,Color.black);      sessionPane.setIconAt(index,unfocused);      SwingUtilities.invokeLater(new Runnable() {         public void run() {            int index1 = index;            if (index1 < sessionPane.getTabCount() - 1) {               sessionPane.setSelectedIndex(++index1);               sessionPane.setForegroundAt(index1,Color.blue);               sessionPane.setIconAt(index1,focused);            }            else {               sessionPane.setSelectedIndex(0);               sessionPane.setForegroundAt(0,Color.blue);               sessionPane.setIconAt(0,focused);            }            ((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus();            setTitle();       }      });   }