!7 cmodule NestedDesktopPane { transient JDesktopPane desktopPane; L windows = syncL(); sclass Win { Rect rect; S title; transient JInternalFrame frame; } visual withCenteredButtons(desktopPane = jDesktopPane(), "Add frame", rThreadEnter addAFrame); void addAFrame { JInternalFrame f = showInternalFrame(desktopPane, "Hello world"); new Win win; win.rect = boundsAsRect(f); win.title = getTitle(f); win.frame = f; windows.add(win); change(): } void restoreFrames { for (Win win : windows) win.frame = setBounds(win.rect, showInternalFrame(desktopPane, win.title)); } }