List of usage examples for javafx.scene.layout RowConstraints setValignment
public final void setValignment(VPos value)
From source file:eu.over9000.skadi.ui.dialogs.UpdateAvailableDialog.java
public UpdateAvailableDialog(RemoteVersionResult newVersion) { super(AlertType.INFORMATION, null, UPDATE_BUTTON_TYPE, IGNORE_BUTTON_TYPE); this.setTitle("Update available"); this.setHeaderText(newVersion.getVersion() + " is available"); Label lbChangeLog = new Label("Changelog:"); TextArea taChangeLog = new TextArea(newVersion.getChangeLog()); taChangeLog.setEditable(false);//from w ww .j a v a 2 s .c o m taChangeLog.setWrapText(true); Label lbSize = new Label("Size:"); Label lbSizeValue = new Label(FileUtils.byteCountToDisplaySize(newVersion.getSize())); Label lbPublished = new Label("Published"); Label lbPublishedValue = new Label( ZonedDateTime.parse(newVersion.getPublished()).format(DateTimeFormatter.RFC_1123_DATE_TIME)); final GridPane grid = new GridPane(); RowConstraints vAlign = new RowConstraints(); vAlign.setValignment(VPos.TOP); grid.getRowConstraints().add(vAlign); grid.setHgap(10); grid.setVgap(10); grid.add(lbChangeLog, 0, 0); grid.add(taChangeLog, 1, 0); grid.add(lbPublished, 0, 1); grid.add(lbPublishedValue, 1, 1); grid.add(lbSize, 0, 2); grid.add(lbSizeValue, 1, 2); this.getDialogPane().setContent(grid); }
From source file:Main.java
private GridPane createGridPane() { final GridPane gp = new GridPane(); gp.setPadding(new Insets(10)); gp.setHgap(20);// www . j av a 2s . 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; }
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);// w w w .java 2 s . co m 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; }