Windows & dialogs
Note: These pages are being reviewed.
Yes, you could; but please instead use the standard windowing system to do these sorts of things. Then you will properly handle docking, separated floating windows, 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 `TopComponent`s 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
NotifyDescriptorto represent simple messages; exceptions; general-purpose dialogs with content panels; or even multi-stage wizards.
Easiest way is to use File → New File wizard, Module Development category and Wizard item, which will generate all needed boilerplate code for you. Essentially what wizard does is described below:
You should start with creating a set (at least one) on WizardDescriptor.Panel objects (see Wizard Panel Performance Guide for more information about the best way to create a panel).
Use the panels to tell the a WizardDescriptor instance the sequence of panels it should display.
This you can do either directly by
WizardDescriptor wd = WizardDescriptor(wizardPanelArray)
Or you can create a
WizardDescriptor.Iterator with these panels, which gives you more control over the sequencing.
Set certain properties on the WizardDescriptor which can influence the appearence of the wizard. If you like to add a help pane for example you call:
This will display a help html file which has to be defined on each panel by setting a
clientProperty in the JComponent superclass of the panel that is the wizard content. In this case it would look like: