MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames();   int index = desktop.getIndexOf(targetSession);
int index = getIndexOfSession(targetSession);
   public void removeSessionView(Session targetSession) {      MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames();      int index = desktop.getIndexOf(targetSession);      System.out.println("session found and closing down " + index);      targetSession.removeSessionListener(this);      targetSession.removeSessionJumpListener(this);      desktop.remove(index);//      sessionPane.remove(index);//      if (index < (sessionPane.getTabCount() - 2)) {//         sessionPane.setSelectedIndex(index);//         sessionPane.setForegroundAt(index,Color.blue);//         sessionPane.setIconAt(index,focused);//      }//      else {////         if (sessionPane.getTabCount() > 0) {//            sessionPane.setSelectedIndex(0);//            sessionPane.setForegroundAt(0,Color.blue);//            sessionPane.setIconAt(0,focused);//         }////      }   }