Yes, you could; but please instead use the standard windowing system to do these sorts of things. Then you will properly handle workspace switching, docking, context help, various keyboard shortcuts, and many other things contributing to the IDE's appearance and functionality.

The Window System API describes the general steps you should use to open up new function windows, if you need such a thing. Specifically, you should use TopComponents for such purposes.

You can also use DialogDisplayer.notify(NotifyDescriptor?) to show dialogs that interact well with the IDE's window system, and have a number of bits of prebuilt UI. You can use various standard subclasses of NotifyDescriptor to represent simple messages; exceptions; general-purpose dialogs with content panels; or even multi-stage wizards.

Source: NetBeans FAQ