Class WizardDescriptor allows developer to create wizard from supplied WizardDescriptor.Iterator or array of WizardDesriptor.Panel. It also allows wizard developer to easy satisfy UI Guidelines for Wizards in NetBeans.

WizardDescriptor can create wizard panel (steps, graphics, help on the left; subtitle and user panel on the right). To achieve that, developer have to use WizardDescriptor.putProperty() or JComponent.putClientProperty() in his/her panel to set needed properties (e.g. String[] for steps, URL for help, some Boolean for layout control, ...).

To create simple wizard try this:
WizardDescriptor wd = new WizardDescriptor(
    new WizardDescriptor.Panel[] = { 
It will create four steps wizard with no additional graphic. To achieve creation of subtitle, steps pane, help tab, ... one have to set initialization properties.

Wizard panel initialization

Use WizardDescriptor.putProperty() to set following initialization properties.

  • Name "WizardPanel_contentDisplayed", type Boolean
    Set to Boolean.TRUE to turn on displaying of steps pane (content, behind which can be displayed image). Content will be constructed from not initialization property "WizardPanel_contentData".

  • Name "WizardPanel_helpDisplayed", type Boolean
    Set to Boolean.TRUE to turn on displaying of help (html browser). Help will be taken from not initialization property "WizardPanel_helpURL". If also steps are displayed then put help and content panes into tabbed pane.

  • Name "WizardPanel_contentNumbered", type Boolean
    Set to Boolean.TRUE to turn on numbering of steps (before every step is placed it's sequence number).

  • Name "WizardPanel_leftDimension", type Dimension
    Set size of left pane (steps and help pane).
  • That was initialization part. All Boolean properties are Boolean.FALSE by default. Initialization properties could be set also in the first panel (through JComponent.putClientProperty()) of supplied iterator. Later change of these properties will not cause change of wizard behavior. Properties have to be set before TopManager.getDefault().createDialog(wd) is called.
    Follow properties which could be changed at wizard runtime.

    Wizard panel properties

    These properties could be changed dynamically.
    • Name "WizardPanel_contentData", type String[]
      Set step names which will be displayed in the content pane.

    • Name "WizardPanel_image", type java.awt.Image
      Set image displayed as background of content.

  • Set subtitle (!!!) format with WizardDescriptor.setTitleFormat().

  • Set title of the wizard with WizardDescriptor.setTitle().

  • Name "WizardPanel_errorMessage", type String
    Set the localized message which is then shown at the bottom of the wizard panel. This message should be set when panel becomes invalid and Next/Finish buttons are disabled. It helps user to understand what is wrong. The property must be set to null value to clear the message. This property is supported since NetBeans 3.5.
  • In every panel set these client properties (JComponent.putClientProperty()):
    • Name "WizardPanel_helpURL", type java.net.URL
      Help url which explains your pane.

  • Name "WizardPanel_contentSelectedIndex", type java.lang.Integer
    Index of highlighted step in the content.

  • Name "WizardPanel_contentBackgroundColor", type java.awt.Color
    Color used as background of content pane.

  • Set name of panel JComponent.setName("First wizard panel"), used as first part of subtitle, second is WizardDescriptor.Panel.name() when you use "{0}{1}" message format.
  • All properties could be set with both alternatives ( WizardDescriptor.putProperty() or JComponent.putClientProperty()) except "WizardPanel_helpURL" which can be set only with JComponent.putClientProperty(). If both are used at the same time then WizardDescriptor.putProperty() matters. WizardDescriptor listens on property changes of not initialization properties and makes immediate changes.

    Project Features

    About this Project

    ui was started in November 2009, is owned by Jiří Kovalský, and has 44 members.
    By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20160708.bf2ac18). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
    Please Confirm