Extreme Component

ComponentSet Programmer Guide > JWizardPane

JWizardPane - Java Wizard Framework

JWizardPane provides a Java wizard framework.

Create Wizard

The JWizardPane component support the AWT and Swing component, so add a wizard page is 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 support show 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 style, 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 support many properties to change it's look and feel, such as logo text, logo icon, banner image, side image.

Introduces the WizardListener

The JWizardPane fires a wizard event when the actions of the control button has been fired.


Copyright (c) zfqjava.com
All rights reserved.