Skip to main content
A stepper component that guides users through a multi-step process, displaying progress and providing navigation controls.

Constructor

JStepper()
constructor
Creates a new stepper component with horizontal orientation.

Methods

Step Management

addStep(String title, String subtitle, Node content)
void
Adds a new step to the stepper.
addStep(Step step)
void
Adds a pre-configured Step object.
setSteps(Iterable<Step> newSteps)
void
Replaces all steps with a new collection.
getSteps()
ObservableList<Step>
Returns the observable list of steps.
returns
ObservableList<Step>
The list of all steps
getCurrentStepIndex()
int
Gets the current step index (0-based).
returns
int
The current step index
setCurrentStepIndex(int index)
void
Sets the current step by index.
nextStep()
void
Advances to the next step if available.
previousStep()
void
Returns to the previous step if available.
finish()
void
Triggers the finish callback if set.

Configuration

setOrientation(Orientation orientation)
void
Sets the stepper orientation.
getOrientation()
Orientation
Gets the current orientation.
returns
Orientation
The current orientation

Callbacks

setOnStepChange(BiConsumer<Integer, Integer> callback)
void
Sets a callback that fires when the step changes.
setOnFinish(Runnable callback)
void
Sets a callback to execute when the finish button is clicked.

Component Access

getBackButton()
JButton
Returns the back button for customization.
getNextButton()
JButton
Returns the next button for customization.
getFinishButton()
JButton
Returns the finish button for customization.
getHeaderBox()
Pane
Returns the header container (HBox or VBox depending on orientation).
getContentPane()
StackPane
Returns the content pane where step content is displayed.
Returns the footer box containing navigation buttons.

Inner Classes

Step

Step(String title, String subtitle, Node content)
constructor
Creates a new step.
Step Methods:
  • String getTitle() / void setTitle(String title)
  • String getSubtitle() / void setSubtitle(String subtitle)
  • Node getContent() / void setContent(Node content)

Usage Example

JStepper stepper = new JStepper();

// Add steps
stepper.addStep("Account", "Create your account", accountForm);
stepper.addStep("Profile", "Set up your profile", profileForm);
stepper.addStep("Preferences", "Configure settings", prefsForm);

// Set callbacks
stepper.setOnStepChange((oldIdx, newIdx) -> {
    System.out.println("Step changed: " + oldIdx + " -> " + newIdx);
});

stepper.setOnFinish(() -> {
    System.out.println("Wizard completed!");
});

// Customize buttons
stepper.getNextButton().setText("Continue");
stepper.getBackButton().setText("Previous");

Style Classes

  • .j-stepper - Main container
  • .j-stepper-header - Header container (horizontal)
  • .j-stepper-header-vertical - Header container (vertical)
  • .j-stepper-content - Content pane
  • .j-stepper-footer - Footer with buttons
  • .j-stepper-step-box - Individual step container
  • .j-stepper-icon-pane - Step icon container
  • .j-stepper-circle - Step circle background
  • .j-stepper-number - Step number/icon
  • .j-stepper-title - Step title label
  • .j-stepper-subtitle - Step subtitle label
  • .j-stepper-line - Connecting line between steps
  • .active - Active step state
  • .completed - Completed step state
  • .pending - Pending step state

Build docs developers (and LLMs) love