Example usage for javafx.scene.layout BorderPane setTop

List of usage examples for javafx.scene.layout BorderPane setTop

Introduction

In this page you can find the example usage for javafx.scene.layout BorderPane setTop.

Prototype

public final void setTop(Node 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 ww.j  a va 2 s  . com
    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:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane bp = new BorderPane();
    bp.setPadding(new Insets(10, 20, 10, 20));

    Button btnTop = new Button("Top");
    bp.setTop(btnTop);

    Button btnLeft = new Button("Left");
    bp.setLeft(btnLeft);/*from  ww w  . ja v a 2  s . com*/

    Button btnCenter = new Button("Center");
    bp.setCenter(btnCenter);

    Button btnRight = new Button("Right");
    bp.setRight(btnRight);

    Button btnBottom = new Button("Bottom");
    bp.setBottom(btnBottom);

    Scene scene = new Scene(bp, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("BorderPane Test");
    BorderPane bp = new BorderPane();
    bp.setPadding(new Insets(10, 20, 10, 20));

    Button btnTop = new Button("Top");
    bp.setTop(btnTop);

    Button btnLeft = new Button("Left");
    bp.setLeft(btnLeft);//  ww w .  j  av  a2 s  . c  om

    Button btnCenter = new Button("Center");
    bp.setCenter(btnCenter);

    Button btnRight = new Button("Right");
    bp.setRight(btnRight);

    Button btnBottom = new Button("Bottom");
    bp.setBottom(btnBottom);

    Scene scene = new Scene(bp, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane bp = new BorderPane();
    bp.setPadding(new Insets(10, 20, 10, 20));

    Button btnTop = new Button("Top");
    bp.setTop(btnTop);

    Button btnLeft = new Button("Left");
    bp.setLeft(btnLeft);/*w  ww. j  a  va 2  s .  c  o m*/

    Button btnCenter = new Button("Center");
    bp.setCenter(btnCenter);

    Button btnRight = new Button("Right");
    bp.setRight(btnRight);

    Button btnBottom = new Button("Bottom");
    bp.setBottom(btnBottom);

    Scene scene = new Scene(bp, 300, 200);
    primaryStage.setScene(scene);
    primaryStage.show();

    System.out.println(bp.getTop());
    System.out.println(bp.getBottom());
    System.out.println(bp.getLeft());
    System.out.println(bp.getRight());
    System.out.println(bp.getCenter());
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane root = new BorderPane();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    MenuBar menuBar = new MenuBar();
    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());
    root.setTop(menuBar);

    Menu fileMenu = new Menu("File");
    MenuItem exitMenuItem = new MenuItem("Exit");
    fileMenu.getItems().add(exitMenuItem);
    exitMenuItem.setOnAction(actionEvent -> Platform.exit());

    menuBar.getMenus().addAll(fileMenu);

    primaryStage.setScene(scene);//from   w w w. j  av  a  2s .  co  m
    primaryStage.show();
}

From source file:be.makercafe.apps.makerbench.editors.TextEditor.java

public TextEditor(String tabText, Path path) {
    super(tabText);

    this.caCodeArea = new CodeArea("");
    this.caCodeArea.setEditable(true);
    this.caCodeArea.setParagraphGraphicFactory(LineNumberFactory.get(caCodeArea));
    this.caCodeArea.setPrefSize(Double.MAX_VALUE, Double.MAX_VALUE);
    addContextMenu(this.caCodeArea);

    try {/*from   ww  w . j  a  va 2  s  . c  om*/
        this.caCodeArea.replaceText(FileUtils.readFileToString(path.toFile()));
    } catch (IOException ex) {
        Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, "Error reading file.", ex);
    }

    BorderPane rootPane = new BorderPane();

    toolBar = createToolBar();
    rootPane.setTop(toolBar);
    rootPane.setCenter(caCodeArea);
    this.getTab().setContent(rootPane);

}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane root = new BorderPane();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    MenuBar menuBar = new MenuBar();
    menuBar.prefWidthProperty().bind(primaryStage.widthProperty());
    root.setTop(menuBar);

    Menu fileMenu = new Menu("_File");
    fileMenu.setMnemonicParsing(true);/*  w w  w  . j  a va2  s.co m*/
    MenuItem exitMenuItem = new MenuItem("Exit");
    fileMenu.getItems().add(exitMenuItem);
    exitMenuItem.setOnAction(actionEvent -> Platform.exit());

    menuBar.getMenus().addAll(fileMenu);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:com.thomaskuenneth.tkmactuning.TKMacTuning.java

@Override
public void start(Stage primaryStage) {
    TabPane tabPane = new TabPane();
    tabPane.setTabClosingPolicy(TabPane.TabClosingPolicy.UNAVAILABLE);
    // Found here: http://stackoverflow.com/a/17488304/5956451
    tabPane.getStyleClass().add("floating");

    // TODO: propper error handling
    JSONTokener t = new JSONTokener(getClass().getResourceAsStream("resources/plugins.json"));
    JSONArray a = new JSONArray(t);
    a.forEach((Object anObject) -> {
        JSONObject jsonObject = (JSONObject) anObject;
        addPlugin(tabPane, jsonObject.getString("class"), jsonObject.getString("pluginName"));
    });/*from  ww  w .  j  a  v a2s. co  m*/

    FlowPane buttonsPane = new FlowPane(Orientation.HORIZONTAL);
    buttonsPane.setPadding(LayoutConstants.PADDING_1);
    buttonsPane.setHgap(LayoutConstants.HORIZONTAL_CONTROL_GAP);
    buttonsPane.setAlignment(Pos.BASELINE_LEFT);
    final Button buttonReread = new Button(getString("reread"));
    buttonReread.setOnAction(event -> {
        PluginManager.reread(this);
    });
    buttonsPane.getChildren().add(buttonReread);
    final Button buttonApply = new Button(getString("apply"));
    buttonApply.setOnAction(event -> {
        PluginManager.save(this);
    });
    buttonsPane.getChildren().add(buttonApply);

    statusbar = new StatusBar();
    BorderPane borderPane = new BorderPane(tabPane);
    borderPane.setTop(buttonsPane);
    borderPane.setBottom(statusbar);
    primaryStage.setScene(new Scene(borderPane, 800, 600));
    primaryStage.setTitle(getString("application_name"));

    ready();
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Title");
    Group root = new Group();
    Scene scene = new Scene(root, 400, 250, Color.WHITE);

    MenuBar menuBar = new MenuBar();
    EventHandler<ActionEvent> action = changeTabPlacement();

    Menu menu = new Menu("Direction");
    MenuItem left = new MenuItem("Left");

    left.setOnAction(action);/*  www.j a v  a  2 s.c o m*/
    menu.getItems().add(left);

    MenuItem right = new MenuItem("Right");
    right.setOnAction(action);
    menu.getItems().add(right);

    MenuItem top = new MenuItem("Top");
    top.setOnAction(action);
    menu.getItems().add(top);

    MenuItem bottom = new MenuItem("Bottom");
    bottom.setOnAction(action);
    menu.getItems().add(bottom);

    menuBar.getMenus().add(menu);

    BorderPane borderPane = new BorderPane();

    borderPane.prefHeightProperty().bind(scene.heightProperty());
    borderPane.prefWidthProperty().bind(scene.widthProperty());

    borderPane.setTop(menuBar);

    root.getChildren().add(borderPane);

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    BorderPane root = new BorderPane();
    Scene scene = new Scene(root, 380, 150, Color.WHITE);

    GridPane gridpane = createGridPane();
    FlowPane topBanner = createTopBanner();

    root.setTop(topBanner);
    root.setCenter(gridpane);/*from  w  w  w  . jav  a2s.c  om*/

    primaryStage.setTitle("Hello World!");
    primaryStage.setScene(scene);
    primaryStage.show();
}