Note: These pages are being reviewed.
Windows & dialogs
Can I just open up my own frames and dialogs?
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.
What are the steps to create a simple Wizard?
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:
Finally you set the Wizard to screen using the
Dialog d = DialogDisplayer.getDefault().createDialog(wd); d.setVisible(true); d.toFront();
Apache Migration Information
The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.
This page was exported from http://wiki.netbeans.org/DevFaqWindowsAndDialogs , that was last modified by NetBeans user Saubrecht on 2009-12-07T10:43:35Z.
NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.