JInternalFrame[] frames = desktop.getAllFrames(); JInternalFrame miv = desktop.getSelectedFrame();
MyInternalFrame[] frames = (MyInternalFrame[])desktop.getAllFrames(); MyInternalFrame miv = (MyInternalFrame)desktop.getSelectedFrame();
   private void nextSession() {      JInternalFrame[] frames = desktop.getAllFrames();      JInternalFrame miv = desktop.getSelectedFrame();      int index = desktop.getIndexOf(miv);      if (index < desktop.getComponentCount() - 1) {         try {            frames[index + 1].setSelected(true);         }         catch (java.beans.PropertyVetoException e) {            System.out.println(e.getMessage());         }      }      else {         try {            frames[0].setSelected(true);         }         catch (java.beans.PropertyVetoException e) {            System.out.println(e.getMessage());         }      }   }