Example usage for javafx.scene.layout HBox setPadding

List of usage examples for javafx.scene.layout HBox setPadding

Introduction

In this page you can find the example usage for javafx.scene.layout HBox setPadding.

Prototype

public final void setPadding(Insets value) 

Source Link

Usage

From source file:RemoveDuplicateFiles.java

public static Scene makeScene() {
    //Setup the main BorderPane (Holds all the things)
    BorderPane backPane = new BorderPane();

    //----------------------------------------------------------------------
    //Setup the Main Menu Buttons & Pane
    sortFilesButton = new Button("Sort Files");
    batchRenameButton = new Button("Batch Rename Files");

    HBox mainButtons = new HBox();
    mainButtons.setPadding(new Insets(15, 12, 15, 12));
    mainButtons.setSpacing(10);//from  w  w w.  j  a v  a 2  s .  co  m
    mainButtons.setStyle(BUTTON_STYLE);

    mainButtons.getChildren().add(sortFilesButton);
    mainButtons.getChildren().add(batchRenameButton);

    backPane.setTop(mainButtons);

    //----------------------------------------------------------------------
    //Setup the filetypes box
    HBox fileTypePane = GUIFactories.getFileTypeBox(fileTypes);
    backPane.setBottom(fileTypePane);

    //----------------------------------------------------------------------
    //Setup the FileType Pre-set Buttons
    VBox preSets = GUIFactories.getPresets(fileTypes);
    backPane.setRight(preSets);

    //----------------------------------------------------------------------
    //Setup the center GridPane
    rmvButton = new Button("Remove Duplicates");
    actionTarget = new Text();

    GridPane grid = GUIFactories.getCenterPane(address, rmvButton, actionTarget);
    backPane.setCenter(grid);

    //----------------------------------------------------------------------
    Scene scene = new Scene(backPane, WIDTH, HEIGHT);
    return scene;

}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private static void addRow4(final Pane content, final BookingBean be) {
    final HBox box = new HBox();
    box.setPadding(new Insets(4));
    box.setAlignment(Pos.CENTER_LEFT);//from  www .ja  va2  s . c o  m
    box.setFillHeight(true);
    final TextFlow tf = new TextFlow();
    final Text t0 = new Text("Net Earnings: \t");
    final Text netEarnings = new Text(String.format("%3.2f", be.getNetEarnings()));
    final Text t1 = new Text(" total \t");
    final Text netEarningsDay = new Text(String.format("%3.2f", be.getNetEarnings() / be.getNumberOfNights()));
    final Text t2 = new Text(" /night");
    tf.getChildren().addAll(t0, netEarnings, t1, netEarningsDay, t2);
    box.getChildren().addAll(tf);
    if (be.getNetEarnings() <= 0) {
        box.getStyleClass().addAll("warning", "warning-bg");
    }
    content.getChildren().add(box);

}

From source file:com.github.drbookings.ui.controller.BookingDetailsController.java

private static void addRow0(final Pane content, final BookingBean be) {
    final HBox box = new HBox();
    final HBox boxName = new HBox();
    final HBox boxDates = new HBox();
    final HBox boxNights = new HBox();
    box.setAlignment(Pos.CENTER);// ww w .j  a  v  a 2s  .  co  m
    boxName.getStyleClass().add("first-line");
    boxDates.getStyleClass().add("first-line");
    boxNights.getStyleClass().add("first-line");
    boxName.setPadding(boxPadding);
    boxDates.setPadding(boxPadding);
    boxNights.setPadding(boxPadding);
    boxName.setAlignment(Pos.CENTER);
    boxDates.setAlignment(Pos.CENTER);
    boxNights.setAlignment(Pos.CENTER);
    HBox.setHgrow(boxName, Priority.ALWAYS);
    HBox.setHgrow(boxDates, Priority.ALWAYS);
    HBox.setHgrow(boxNights, Priority.ALWAYS);
    addName(boxName, be);
    // box.getChildren().add(new Separator(Orientation.VERTICAL));
    addDates(boxDates, be);
    // box.getChildren().add(new Separator(Orientation.VERTICAL));
    addNights(boxNights, be);
    box.getChildren().addAll(boxName, boxDates, boxNights);
    box.getStyleClass().add(Styles.getBackgroundStyleSource(be.getBookingOrigin().getName()));
    content.getChildren().add(box);

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 350, 250);
    TitledPane titledPane = new TitledPane("My Title", new CheckBox("OK"));

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(titledPane);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);/* w  ww.j  av  a  2  s  . co m*/
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);
    TitledPane titledPane = new TitledPane("My Title", new CheckBox("OK"));
    titledPane.setCollapsible(false);//remove closing action
    titledPane.setAnimated(false);//stop animating

    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(titledPane);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);//from w  ww  . j  av a 2  s  . c  o m
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();
    tile.setHgap(8);/* ww  w .j  ava2 s.c om*/
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    System.out.println(tile.prefColumnsProperty());
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();
    tile.setHgap(8);/*from  w w w. j a  v a2 s . c om*/
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    System.out.println(tile.prefRowsProperty());
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();
    tile.setHgap(8);//from   w w w  .j a  v a  2 s .  c om
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    System.out.println(tile.hgapProperty());
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();
    tile.setHgap(8);//from  www  .  j  a va 2s. c  o m
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    System.out.println(tile.getPrefTileHeight());
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group(), 450, 250);

    TilePane tile = new TilePane();
    tile.setHgap(8);/*from w ww  .  ja v a  2 s .  c  o  m*/
    tile.setPrefColumns(4);
    for (int i = 0; i < 20; i++) {
        tile.getChildren().add(new CheckBox("CheckBox"));
    }
    System.out.println(tile.getContentBias());
    HBox hbox = new HBox(10);
    hbox.setPadding(new Insets(20, 0, 0, 20));
    hbox.getChildren().setAll(tile);

    Group root = (Group) scene.getRoot();
    root.getChildren().add(hbox);
    stage.setScene(scene);
    stage.show();
}