dcsimg

How do I activate the topmost JInternalFrame in a JDesktopPane after the currently active JInternalFrame is closed?

Sandip Chitale

  • Listen to the InternalFrame events using the InternalFrameListener.
  • In the public void internalFrameClosed(InternalFrameEvent e) or public void internalFrameClosing(InternalFrameEvent e) call backs get the zeroth JInternalFrame from the JDesktopPane and select it using
    desktopPane.getAllFramesInLayer(inLayerSameAsTheClosingFrame)[0].setSelected(true);