by kordamp

kordamp / bootstrapfx

BootstrapFX: Bootstrap for JavaFX

508 Stars 90 Forks Last release: Not found MIT License 77 Commits 6 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

= BootstrapFX :linkattrs: :project-owner: kordamp :project-repo: maven :project-name: bootstrapfx :project-group: org.kordamp.bootstrapfx :project-version: 0.2.4

image:{project-owner}/{project-name}/master.svg["Build Status (travis)", link="{project-owner}/{project-name}"] image:{project-owner}/{project-name}/workflows/Build/badge.svg["Build Status", link="{project-owner}/{project-name}/actions"] image:["MIT Licensed", link=""] image:{project-owner}/{project-repo}/{project-name}-core/images/download.svg[link="{project-owner}/{project-repo}/{project-name}-core/_latestVersion"] image:{project-group}/{project-name}-core.svg?label=maven[link="|ga|1|{project-group}"] image:[link=""]

BootstrapFX is a partial port of link:[Twitter Bootstrap] for JavaFX. It mainly provides a CSS stylesheet that closely resembles the original while being custom tailored for JavaFX's unique CSS flavor.

It's worth mentioning that Twitter Bootstrap delivers more than just a standardized look for common widgets. It also provides new widgets, behavior and a grid system. Some of these features may be ported at a later stage to BootstrapFX.

There is an link:[online-version] available at link:[].

== Installing

You can get the latest version of BootstrapFX directly from link:[Bintray's JCenter] repository or Maven Central.

[source,groovy] [subs="attributes"]


repositories { jcenter() }

dependencies { compile '{project-group}:bootstrapfx-core:{project-version}'


[source,xml] [subs="attributes,verbatim"]


{project-group} bootstrapfx-core {project-version}

Once the

dependency is in your classpath you just need to apply the
stylesheet to an scene, for example


import javafx.application.Application; import javafx.geometry.Insets; import javafx.scene.Node; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; import org.kordamp.bootstrapfx.scene.layout.Panel;

public class Sampler extends Application { @Override public void start(Stage primaryStage) throws Exception { //<1> Panel panel = new Panel("This is the title"); panel.getStyleClass().add("panel-primary"); //<2> BorderPane content = new BorderPane(); content.setPadding(new Insets(20)); Button button = new Button("Hello BootstrapFX"); button.getStyleClass().setAll("btn","btn-danger"); //<2> content.setCenter(button); panel.setBody(content);

    Scene scene = new Scene(panel);
    scene.getStylesheets().add("org/kordamp/bootstrapfx/bootstrapfx.css"); //<3>




<1> Custom widget from BootstrapFX <2> Apply CSS class to widgets <3> Apply BootstrapFX stylesheet to scene

=== Java 9+

BootstrapFX can be used in a modular fashion when running in Java9+. It's module name is


== Building

You must meet the following requirements:

  • JDK8u60 as a minimum
  • Gradle 5.2

You may used the included gradle wrapper script if you don't have


=== Installing Gradle


. Download Gradle from . Unzip the file into a directory without spaces (recommended). . Create a GRADLEHOME environment variable that points to this directory. . Adjust your PATH environment variable to include $GRADLEHOME/bin (%GRADLE_HOME%\bin on Windows). . Test your setup by invoking

gradle --version


. Follow the instructions found at to install SDKMAN. . You need a POSIX environment if running Windows. We recommend using Babun Shell ( . Once SDKMAN is installed invoke

sdk install gradle 5.2
. . Test your setup by invoking
gradle --version


Gum is a wrapper script that facilitates invoking gradle tasks anywhere within a Gradle project. It's smart enough to use the gradle wrapper if available or your global gradle command. This is an optional download.

. Follow the instructions found at to install gum

=== Next Steps

. Make a full build by invoking the following command


$ ./gradlew build

. Run the sampler application by invoking the following command


$ ./gradlew :sampler:run

. Run the sampler application with link:[JPro] by invoking the following command


$ ./gradlew :sampler-jpro:jproRun

== Supported CSS Classes

=== Text

  • b, strong
  • i, em, italic, dfn
  • small
  • code, kbd, pre, samp
  • h1, h2, h3, h4, h5, h6
  • lead
  • p
  • text-mute
  • text-primary, text-success, text-info, text-warning, text-danger
  • bg-primary, bg-success, bg-info, bg-warning, bg-danger

=== Buttons

  • btn
  • btn-default, btn-primary, btn-success, btn-info, btn-warning, btn-danger
  • btn-lg, btn-sm, btn-xs

=== SplitMenu Buttons

  • split-menu-btn
  • split-menu-btn-default, split-menu-btn-primary, split-menu-btn-success, split-menu-btn-info, split-menu-btn-warning, split-menu-btn-danger
  • split-menu-btn-lg, split-menu-btn-sm, split-menu-btn-xs

=== Labels

  • lbl
  • lbl-default, lbl-primary, lbl-success, lbl-info, lbl-warning, lbl-danger

=== Panels

  • panel
  • panel-default, panel-primary, panel-success, panel-info, panel-warning, panel-danger
  • panel-heading
  • panel-title
  • panel-body
  • panel-footer

=== Alerts

  • alert
  • alert-success, alert-info, alert-warning, alert-danger

=== Groups

  • btn-group-horizontal
  • btn-group-vertical

NOTE: all elements inside the vertical button group must have the same width.

=== Progress Bars

  • progress-bar-primary
  • progress-bar-success
  • progress-bar-info
  • progress-bar-warning
  • progress-bar-danger

=== Tooltips

  • tooltip-primary
  • tooltip-success
  • tooltip-info
  • tooltip-warning
  • tooltip-danger

=== Miscellaneous

  • badge

== Screenshots






== Changelog


  • The
    file has been moved to


  • Added
  • Added
  • Tweaked menu items and menus


  • Add
    to JAR manifest


  • POM updates


  • SplitMenu Button support
  • Button group support
  • lead
    on Text


  • First release

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.