sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();
((Session)sessionPane.getComponent(sessionPane.getSelectedIndex())).grabFocus();
   private void prevSession() {      int index = sessionPane.getSelectedIndex();      sessionPane.setForegroundAt(index,Color.black);      sessionPane.setIconAt(index,unfocused);      if (index == 0) {         sessionPane.setSelectedIndex(sessionPane.getTabCount() - 1);         sessionPane.setForegroundAt(sessionPane.getSelectedIndex(),Color.blue);         sessionPane.setIconAt(sessionPane.getSelectedIndex(),focused);      }      else {         sessionPane.setSelectedIndex(--index);         sessionPane.setForegroundAt(index,Color.blue);         sessionPane.setIconAt(index,focused);      }      sessionPane.getComponent(sessionPane.getSelectedIndex()).requestFocus();   }