DevFaqWizardPanelError

Q: How do I show that a user has filled an invalid input into my wizard?

A: Set the WizardPanel_errorMessage property in the WizardPanel instance that is related to the displayed panel.

Example:

wizardDescriptor.putProperty("WizardPanel_errorMessage", NbBundle.getMessage(MyPanel1.class, "key"));

Note: Since WizardDescritor, spec.version 7.8 (i.e.since NetBeans 6.5 Platform)

  • you can use WizardDescriptor.PROP_ERROR_MESSAGE instead of "WizardPanel_errorMessage".
  • beside WizardDescriptor.PROP_ERROR_MESSAGE you can also use WizardDescriptor.PROP_WARNING_MESSAGE for warning messages or WizardDescriptor.PROP_INFO_MESSAGE for information messages.
  • All kind of messages will be badged with appropriate icons: error File:Error.gif, warning File:Warning.gif, info File:info.png
  • To clean the message just call wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, null);

You can obtain the instance of WizardDescriptor in the WizardDescriptor.Panel.readSettings as settings parameter method.

Update in NetBeans 6.8

Two new methods in NotifyDescriptor were added to allow API client to create NotificationLineSupport which allow handling error/warning/info messages in dialogs. If a dialog descriptor creates this support, DialogDisplayer allocates necessary space at the bottom of dialog where API clients can set info/warning/error messages with appropriate icons.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo