Skip to content

Instantly share code, notes, and snippets.

@aalmiray
Last active March 17, 2024 07:51
Show Gist options
  • Save aalmiray/5ee101d195b0ca4b9d63 to your computer and use it in GitHub Desktop.
Save aalmiray/5ee101d195b0ca4b9d63 to your computer and use it in GitHub Desktop.
BootstrapFX samples
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.text.Text?>
<?import javafx.scene.text.TextFlow?>
<Tab text="Alerts" closable="false">
<GridPane hgap="10" vgap="10" styleClass="page">
<padding>
<Insets top="20" left="20" bottom="20" right="20"/>
</padding>
<TextFlow GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.hgrow="ALWAYS" styleClass="alert, alert-success">
<Text text="Well done!" styleClass="strong"/>
<Text text=" You successfully read this important alert message."/>
</TextFlow>
<TextFlow GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.hgrow="ALWAYS" styleClass="alert, alert-info">
<Text text="Heads up!" styleClass="strong"/>
<Text text=" This alert needs your attention, but it's not super important."/>
</TextFlow>
<TextFlow GridPane.columnIndex="0" GridPane.rowIndex="2" GridPane.hgrow="ALWAYS" styleClass="alert, alert-warning">
<Text text="Warning!" styleClass="strong"/>
<Text text=" Best check yo self, you're not looking too good."/>
</TextFlow>
<TextFlow GridPane.columnIndex="0" GridPane.rowIndex="3" GridPane.hgrow="ALWAYS" styleClass="alert, alert-danger">
<Text text="Oh snap!" styleClass="strong"/>
<Text text=" Change a few things up and try submitting again."/>
</TextFlow>
<TextFlow GridPane.columnIndex="0" GridPane.rowIndex="4" GridPane.hgrow="ALWAYS" styleClass="alert">
<Text text="Well..." styleClass="strong"/>
<Text text=" This is embarrassing. A plain message without color."/>
</TextFlow>
</GridPane>
</Tab>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<Tab text="Buttons">
<GridPane hgap="10" vgap="10" styleClass="page">
<padding>
<Insets top="20" left="20" bottom="20" right="20"/>
</padding>
<Label GridPane.columnIndex="0" GridPane.rowIndex="0" text="btn btn-lg"/>
<Button GridPane.columnIndex="1" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-default" text="Default"/>
<Button GridPane.columnIndex="2" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-primary" text="Primary"/>
<Button GridPane.columnIndex="3" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-success" text="Success"/>
<Button GridPane.columnIndex="4" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-info" text="Info"/>
<Button GridPane.columnIndex="5" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-warning" text="Warning"/>
<Button GridPane.columnIndex="6" GridPane.rowIndex="0" styleClass="btn, btn-lg, btn-danger" text="Danger"/>
<Label GridPane.columnIndex="0" GridPane.rowIndex="1" text="btn"/>
<Button GridPane.columnIndex="1" GridPane.rowIndex="1" styleClass="btn, btn-default" text="Default"/>
<Button GridPane.columnIndex="2" GridPane.rowIndex="1" styleClass="btn, btn-primary" text="Primary"/>
<Button GridPane.columnIndex="3" GridPane.rowIndex="1" styleClass="btn, btn-success" text="Success"/>
<Button GridPane.columnIndex="4" GridPane.rowIndex="1" styleClass="btn, btn-info" text="Info"/>
<Button GridPane.columnIndex="5" GridPane.rowIndex="1" styleClass="btn, btn-warning" text="Warning"/>
<Button GridPane.columnIndex="6" GridPane.rowIndex="1" styleClass="btn, btn-danger" text="Danger"/>
<Label GridPane.columnIndex="0" GridPane.rowIndex="2" text="btn btn-sm"/>
<Button GridPane.columnIndex="1" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-default" text="Default"/>
<Button GridPane.columnIndex="2" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-primary" text="Primary"/>
<Button GridPane.columnIndex="3" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-success" text="Success"/>
<Button GridPane.columnIndex="4" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-info" text="Info"/>
<Button GridPane.columnIndex="5" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-warning" text="Warning"/>
<Button GridPane.columnIndex="6" GridPane.rowIndex="2" styleClass="btn, btn-sm, btn-danger" text="Danger"/>
<Label GridPane.columnIndex="0" GridPane.rowIndex="3" text="btn btn-xs"/>
<Button GridPane.columnIndex="1" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-default" text="Default"/>
<Button GridPane.columnIndex="2" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-primary" text="Primary"/>
<Button GridPane.columnIndex="3" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-success" text="Success"/>
<Button GridPane.columnIndex="4" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-info" text="Info"/>
<Button GridPane.columnIndex="5" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-warning" text="Warning"/>
<Button GridPane.columnIndex="6" GridPane.rowIndex="3" styleClass="btn, btn-xs, btn-danger" text="Danger"/>
</GridPane>
</Tab>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.GridPane?>
<Tab text="Labels">
<GridPane hgap="10" vgap="10" styleClass="page">
<padding>
<Insets top="20" left="20" bottom="20" right="20"/>
</padding>
<Label GridPane.columnIndex="0" GridPane.rowIndex="0" text="lbl h1"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="0" hgap="10" vgap="10" styleClass="h1">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="1" text="lbl h2"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="1" hgap="10" vgap="10" styleClass="h2">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="2" text="lbl h3"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="2" hgap="10" vgap="10" styleClass="h3">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="3" text="lbl h4"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="3" hgap="10" vgap="10" styleClass="h4">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="4" text="lbl h5"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="4" hgap="10" vgap="10" styleClass="h5">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="5" text="lbl h6"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="5" hgap="10" vgap="10" styleClass="h6">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
<Label GridPane.columnIndex="0" GridPane.rowIndex="6" text="lbl p"/>
<GridPane GridPane.columnIndex="1" GridPane.rowIndex="6" hgap="10" vgap="10" styleClass="p">
<Label GridPane.columnIndex="0" styleClass="lbl, lbl-default" text="Default"/>
<Label GridPane.columnIndex="1" styleClass="lbl, lbl-primary" text="Primary"/>
<Label GridPane.columnIndex="2" styleClass="lbl, lbl-success" text="Success"/>
<Label GridPane.columnIndex="3" styleClass="lbl, lbl-info" text="Info"/>
<Label GridPane.columnIndex="4" styleClass="lbl, lbl-warning" text="Warning"/>
<Label GridPane.columnIndex="5" styleClass="lbl, lbl-danger" text="Danger"/>
</GridPane>
</GridPane>
</Tab>
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.layout.GridPane?>
<?import org.kordamp.boostrapfx.scene.layout.Panel?>
<Tab text="Panels" closable="false">
<GridPane hgap="10" vgap="10" styleClass="page">
<padding>
<Insets top="20" left="20" bottom="20" right="20"/>
</padding>
<Panel GridPane.columnIndex="0" GridPane.rowIndex="0" GridPane.hgrow="ALWAYS" styleClass="panel-default">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
<Panel GridPane.columnIndex="1" GridPane.rowIndex="0" GridPane.hgrow="ALWAYS" styleClass="panel-success">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
<Panel GridPane.columnIndex="2" GridPane.rowIndex="0" GridPane.hgrow="ALWAYS" styleClass="panel-warning">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
<Panel GridPane.columnIndex="0" GridPane.rowIndex="1" GridPane.hgrow="ALWAYS" styleClass="panel-primary">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
<Panel GridPane.columnIndex="1" GridPane.rowIndex="1" GridPane.hgrow="ALWAYS" styleClass="panel-info">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
<Panel GridPane.columnIndex="2" GridPane.rowIndex="1" GridPane.hgrow="ALWAYS" styleClass="panel-danger">
<heading>
<Label styleClass="h3" text="Panel title"/>
</heading>
<body>
<Label text="Panel body"/>
</body>
</Panel>
</GridPane>
</Tab>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment