Example usage for javafx.scene.control Button setLayoutX

List of usage examples for javafx.scene.control Button setLayoutX

Introduction

In this page you can find the example usage for javafx.scene.control Button setLayoutX.

Prototype

public final void setLayoutX(double value) 

Source Link

Usage

From source file:photobooth.views.ExplorerPane.java

private void addNextButton() throws IOException {
    Button button = new Button();
    button.setGraphic(/* w  w  w  .j a  v a2  s  . c  om*/
            new ImageView(new Image(getClass().getResource("/photobooth/images/next.png").openStream())));
    button.setStyle("-fx-background-radius: 50%; ");
    button.setStyle("-fx-background-color: transparent;");
    button.setLayoutX(740);
    button.setLayoutY(220);
    button.setMaxSize(50, 50);
    button.setMinSize(50, 50);
    this.getChildren().add(button);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            Global.getInstance().setSceneRoot(LoadingPane.getInstance());
            Platform.runLater(() -> {
                new Thread(new Runnable() {

                    @Override
                    public void run() {
                        ExplorerPane.getInstance().setDir(dir, offset + limit, limit, directoryLevel);
                        Global.getInstance().setSceneRoot(ExplorerPane.getInstance());
                    }
                }).start();
            });
        }
    });
}

From source file:photobooth.views.ExplorerPane.java

private void addPrevButton() throws IOException {
    Button button = new Button();
    button.setGraphic(//from  w ww.  j  a  va2  s.co  m
            new ImageView(new Image(getClass().getResource("/photobooth/images/prev.png").openStream())));
    button.setStyle("-fx-background-radius: 50%; ");
    button.setStyle("-fx-background-color: transparent;");
    button.setLayoutX(10);
    button.setLayoutY(220);
    button.setMaxSize(50, 50);
    button.setMinSize(50, 50);
    this.getChildren().add(button);
    button.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            Global.getInstance().setSceneRoot(LoadingPane.getInstance());
            Platform.runLater(() -> {
                new Thread(new Runnable() {

                    @Override
                    public void run() {
                        ExplorerPane.getInstance().setDir(dir, offset - limit, limit, directoryLevel);
                        Global.getInstance().setSceneRoot(ExplorerPane.getInstance());
                    }
                }).start();
            });
        }
    });
}