It seems that JInternalFrames can only be added to a JDesktopPane and you have to set your JFrame’s content pane to that JDesktopPane. Something like:
JFrame frame = new JFrame();
JDesktopPane desktopPane = new JDesktopPane();
JInternalFrame internalFrame = new JInternalFrame();
desktopPane.add(internalFrame);
frame.setContentPane(desktopPane);
The problem is that the JInternalFrames are allowed to move over anything that I add to the JFrame, like JPanels.
Is there a way for me to add the JInternalFrames/JDesktopPane to something else like a JPanel? That way I can restrict the JInternalFrames to be within that JPanel. If that is not possible, then what other options do I have?