Nothing to do with NetBeans. Read the API for JDesktopPane and JInternalFrame and follow the link to the Swing tutorials on How to Use Internal Frames.

Your question is a classic example of using...