-
Notifications
You must be signed in to change notification settings - Fork 1
DevFaqWindowsAndDialogs
-
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 ofNotifyDescriptor
to 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:
wd.putProperty("WizardPanel_autoWizardStyle",Boolean.TRUE);
wd.putProperty("WizardPanel_helpDisplayed",Boolean.TRUE);
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:
putClientProperty("WizardPanel_helpURL",new URL("http://path/to/help/html/file/panelHelp.html"));
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-01-26, and needs to be reviewed.
Apache NetBeans is an effort undergoing incubation at The Apache Software Foundation (ASF).
Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
This wiki is an experiment pending Apache NetBeans Community approval.