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