InternalFrame
class displays a Frame/Stage-like window on the desktop pane within another window. Compared to a stage an internal frame is always
lightweight and not controlled by the OS. Usually, you add internal frames to a desktop pane. The desktop pane is an instance of DesktopPane
, which
is a subclass of Pane
with the ability to manage multiple overlapping internal frames. The demo can be downloaded from the link below.
InternalFrame iFrame = new InternalFrame("Frame A", createTabPane(), 400, 300);
String url = getClass().getResource("/resources/icon.png").toExternalForm();
iFrame.getIcons().add(new Image(url));
//set position
iFrame.relocate(300, 200);
//select and move to front
iFrame.setSelected(true);
DesktopPane desktopPane = new DesktopPane();
desktopPane.getChildren().add(iFrame);