Example usage for javafx.scene.layout GridPane REMAINING

List of usage examples for javafx.scene.layout GridPane REMAINING

Introduction

In this page you can find the example usage for javafx.scene.layout GridPane REMAINING.

Prototype

int REMAINING

To view the source code for javafx.scene.layout GridPane REMAINING.

Click Source Link

Document

Sentinel value which may be set on a child's row/column span constraint to indicate that it should span the remaining rows/columns.

Usage

From source file:Main.java

private void createClipList(GridPane grid) {
    final VBox vbox = new VBox(30);
    vbox.setAlignment(Pos.TOP_CENTER);/*from www. j  av  a2 s  .co  m*/

    final Label clipLabel = new Label("Code Monkey To-Do List:");
    clipLabel.setId("clipLabel");

    final Button getUpButton = new Button("Get Up, Get Coffee");
    getUpButton.setPrefWidth(300);
    getUpButton.setOnAction(createPlayHandler(coffeeClip));

    final Button goToJobButton = new Button("Go to Job");
    goToJobButton.setPrefWidth(300);
    goToJobButton.setOnAction(createPlayHandler(jobClip));

    final Button meetingButton = new Button("Have Boring Meeting");
    meetingButton.setPrefWidth(300);
    meetingButton.setOnAction(createPlayHandler(meetingClip));

    final Hyperlink link = new Hyperlink("About Code Monkey...");
    link.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent event) {
            WebView wv = new WebView();
            wv.getEngine().load("http://www.jonathancoulton.com/2006/04/14/" + "thing-a-week-29-code-monkey/");

            Scene scene = new Scene(wv, 720, 480);

            Stage stage = new Stage();
            stage.setTitle("Code Monkey");
            stage.setScene(scene);
            stage.show();
        }
    });

    vbox.getChildren().addAll(clipLabel, getUpButton, goToJobButton, meetingButton, link);

    GridPane.setHalignment(vbox, HPos.CENTER);
    GridPane.setHgrow(vbox, Priority.ALWAYS);
    GridPane.setVgrow(vbox, Priority.ALWAYS);
    grid.add(vbox, 0, 0, GridPane.REMAINING, 1);
}

From source file:AudioPlayer3.java

@Override
protected Node initView() {
    final Label title = createLabel("title");
    final Label artist = createLabel("artist");
    final Label album = createLabel("album");
    final Label year = createLabel("year");
    final ImageView albumCover = createAlbumCover();

    title.textProperty().bind(songModel.titleProperty());
    artist.textProperty().bind(songModel.artistProperty());
    album.textProperty().bind(songModel.albumProperty());
    year.textProperty().bind(songModel.yearProperty());
    albumCover.imageProperty().bind(songModel.albumCoverProperty());

    final GridPane gp = new GridPane();
    gp.setPadding(new Insets(10));
    gp.setHgap(20);/*from  www  .  j  av  a 2 s .  c om*/
    gp.add(albumCover, 0, 0, 1, GridPane.REMAINING);
    gp.add(title, 1, 0);
    gp.add(artist, 1, 1);
    gp.add(album, 1, 2);
    gp.add(year, 1, 3);

    final ColumnConstraints c0 = new ColumnConstraints();
    final ColumnConstraints c1 = new ColumnConstraints();
    c1.setHgrow(Priority.ALWAYS);
    gp.getColumnConstraints().addAll(c0, c1);

    final RowConstraints r0 = new RowConstraints();
    r0.setValignment(VPos.TOP);
    gp.getRowConstraints().addAll(r0, r0, r0, r0);

    return gp;
}