Class JWizard

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants
Direct Known Subclasses:
JDataStoreWizard, JParameterListWizard, JProcessWizard

public class JWizard extends JDialog
Swing does not provide a wizard construct (boo hiss) so this is a quick dialog that can step us through a series of pages.

This code is based on Creating Wizard Dialogs with Java.

Author:
Jody, gdavis
See Also:
  • Field Details

    • FINISH

      public static final int FINISH
      Indicates that the 'Finish' button was pressed to close the dialog.
      See Also:
    • CANCEL

      public static final int CANCEL
      Indicates that the 'Cancel' button was pressed to close the dialog, or the user pressed the close box in the corner of the window.
      See Also:
    • ERROR

      public static final int ERROR
      Indicates that the dialog closed due to an internal error.
      See Also:
  • Constructor Details

  • Method Details

    • isCancelEnabled

      public Boolean isCancelEnabled()
    • setCancelEnabled

      public void setCancelEnabled(Boolean isEnabled)
    • isNextEnabled

      public Boolean isNextEnabled()
    • setNextEnabled

      public void setNextEnabled(Boolean isEnabled)
    • setFinishEnabled

      public void setFinishEnabled(Boolean isEnabled)
    • isBackEnabled

      public Boolean isBackEnabled()
    • setBackEnabled

      public void setBackEnabled(Boolean isEnabled)
    • close

      protected void close(int code)
      Closes the dialog and sets the return code to the integer parameter.
      Parameters:
      code - The return code.
    • windowClosing

      public void windowClosing(WindowEvent e)
    • getReturnCode

      public int getReturnCode()
      Retrieves the last return code set by the dialog.
      Returns:
      An integer that identifies how the dialog was closed. See the *_RETURN_CODE constants of this class for possible values.
    • showModalDialog

      public int showModalDialog()
      Convenience method that displays a modal wizard dialog and blocks until the dialog has completed.
      Returns:
      Indicates how the dialog was closed one of CANCEL, ERROR, FINISH
    • setCurrentPanel

      public void setCurrentPanel(String id)
      Called to display a page.

    • registerWizardPanel

      public void registerWizardPanel(JPage page)
      Registers the page with this JWizard. The page is stored by its identifier (so other pages can look it up). The page.setJWizard() method is also called so the page can refer to its containing wizard at runtime.
    • getController

      public JWizard.Controller getController()
      The controller can be hooked up to your own fields or lists; it will call syncWizardButtons() which will use validate to update the buttons in response to user input.
      Returns:
      Controller