This requires to change the form superclass. It is not supported directly, but it can be achieved by the following steps. For example, we want to change a JFrame form to JPanel form:
- Open the JFrame form and remove everything incompatible with the target type (in our case remove windowClosing event, and also menubar if set, which cannot be used in JPanel).
- Save and close the form.
- Open just the java file in the Source view (use Edit action from context menu).
- Change the superclass to the desired class (javax.swing.JPanel).
- Save and close the java file.
- Open the form again — the code is regenerated for the new type automatically (in our case all getContentPane() calls disappear).
- Save the form and you are done.
Applies to: All NetBeans versions
Platforms: All