selectedIndex--;
   private void prevSession() {      MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames();      MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame();      int index = desktop.getIndexOf(miv);      if (index == 0) {//         desktop.setSelectedFrame(frames[frames.length - 1]);         try {            frames[frames.length - 1].setSelected(true);            frames[frames.length - 1].repaint();         }         catch (java.beans.PropertyVetoException e) {            System.out.println(e.getMessage());         }      }      else {         try {            frames[index - 1].setSelected(true);            frames[index - 1].repaint();         }         catch (java.beans.PropertyVetoException e) {            System.out.println(e.getMessage());         }      }   }