JComponentSet Programmer Guide > JWizardPane

JWizardPane - Java Wizard Framework

JWizardPane provides a Java wizard framework.

Create Wizard

The JWizardPane component supports the AWT and Swing component, so adds a wizard page as same as add a plain panel. Any component includes AWT and Swing components can be added into JWizardPane directly.

Code Samples:

// create the JWizardPane
JWizardPane wizardPane = new JWizardPane();
// configure the side image, banner image, logo icon, logo text
wizardPane.setSideImage(sideImage);
wizardPane.setBannerImage(bannerImage);
wizardPane.setLogoIcon(logoIcon);
wizardPane.setLogoText(logoText);
// configure the control button
wizardPane.getControlButton(JWizardPane.FINISH_CONTROL).setVisible(false);
wizardPane.getControlButton(JWizardPane.HELP_CONTROL).setVisible(false);
// add the wizard pane
wizardPane.addPage(createPanel1()); // welcome page
wizardPane.addPage("header", "description", createPanel2()); // interior page
wizardPane.addPage("header", "description", new JButton("text")); // add a JButton
wizardPane.addPage("header", "description", new JFileChooser()); // add a JFileChooser
// add the wizard listener
wizardPane.addWizardListener(createWizardListener());
// add the change listener
wizardPane.addChangeListener(createChangeListener());

Show Wizard

The JWizardPane component supports showing frame and dialog directly.

Code Samples:

// create the JWizardPane, show a frame contains the JWizardPane
JWizardPane pane = createWizardPane();
pane.showFrame("wizard frame");

// create the JWizardPane, show a dialog contains the JWizardPane
pane = createWizardPane();
pane.showDialog(null, "wizard dialog");

Interior Page Style

The JWizardPane component provides two different interior page styles, step tip page style and banner tip page style.

Code Samples:

// change the interiro page style to step tip
JWizardPane pane = createWizardPane();
pane.putClientProperty("JWizardPane.interiorPageStyle", "StepTip");

JWizardPane Properties

The JWizardPane component supports many properties to change its look and feel, such as logo text, logo icon, banner image, side image.

Wizard Event

WizardPage Interface

The page component implements this interface will receive the wizard action notification, the wizard action is "BACK", "NEXT", "CANCEL", "FINISH", "HELP".

Related JavaDoc API List

JWizardPane
WizardPage
WizardAction


Copyright (c) zfqjava.com
All rights reserved.