GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
grid.add(comboBox, 0, 0); grid.add(list, 0, 1); grid.setVgrow(list, Priority.ALWAYS); // make the list grow vertically as much as possible
textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); expContent.setMaxWidth(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
/** * * @param node */ protected void apply(Node node) { // sanatize the node super.apply(node); // apply constraints if (row < 0) throw new IllegalArgumentException("You must set the row index"); javafx.scene.layout.GridPane.setRowIndex(node, row); if (col < 0) throw new IllegalArgumentException("You must set the col index"); javafx.scene.layout.GridPane.setColumnIndex(node, col); javafx.scene.layout.GridPane.setRowSpan(node, rowSpan); javafx.scene.layout.GridPane.setColumnSpan(node, colSpan); javafx.scene.layout.GridPane.setMargin(node, margin != null ? margin : marginReset); if (hgrow != null) GenericLayoutConstraints.overrideMaxWidth(node, this); javafx.scene.layout.GridPane.setHalignment(node, halignment != null ? halignment : halignmentReset); javafx.scene.layout.GridPane.setHgrow(node, hgrow != null ? hgrow : hgrowReset); javafx.scene.layout.GridPane.setValignment(node, valignment != null ? valignment : valignmentReset); if (vgrow != null) GenericLayoutConstraints.overrideMaxHeight(node, this); javafx.scene.layout.GridPane.setVgrow(node, vgrow != null ? vgrow : vgrowReset); } }
GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);
public static void showException(String title, String message, Exception exception) { final Alert alert = new Alert(Alert.AlertType.ERROR); alert.initStyle(StageStyle.UTILITY); alert.setTitle("Exception"); alert.setHeaderText(title); alert.setContentText(message); final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); final String exceptionText = sw.toString(); final Label label = new Label("Details:"); final TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); final GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); }
public ExceptionAlert(Throwable e, String contentText, ButtonType... buttonTypes) { super(AlertType.ERROR, contentText, buttonTypes); String exceptionText = ExceptionUtils.getFullStackTrace(e); Label label = new Label(bundle.getString("stackTraceLabel")); TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); // Set expandable Exception into the dialog pane. this.getDialogPane().setExpandableContent(expContent); } }
private void buildListViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5); // create the listview final ListView<TestPerson> listView = new ListView<TestPerson>(); listView.setItems(data); // set the cell factory Callback<TestPerson, ObservableValue<Boolean>> getProperty = new Callback<TestPerson, ObservableValue<Boolean>>() { @Override public BooleanProperty call(TestPerson person) { // given a person, we return the property that represents // whether or not they are invited. We can then bind to this // bidirectionally. return person.telecommuterProperty(); } }; listView.setCellFactory(CheckBoxListCell.forListView(getProperty)); grid.add(listView, 0, 0); GridPane.setVgrow(listView, Priority.ALWAYS); GridPane.setHgrow(listView, Priority.ALWAYS); tab.setContent(grid); }
private void updateGrid() { grid.getChildren().clear(); // add the message to the top of the dialog updateContentText(); // then build all the buttons int row = 1; for (final ButtonType buttonType : getDialogPane().getButtonTypes()) { if (buttonType == null) continue; final Button button = (Button)getDialogPane().lookupButton(buttonType); GridPane.setHgrow(button, Priority.ALWAYS); GridPane.setVgrow(button, Priority.ALWAYS); grid.add(button, 0, row++); } // // last button gets some extra padding (hacky) // GridPane.setMargin(buttons.get(buttons.size() - 1), new Insets(0,0,10,0)); getDialogPane().setContent(grid); getDialogPane().requestLayout(); }
expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); alert.getDialogPane().setExpandableContent(expContent);
private void buildTableViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5); // create the tableview TableColumn<TestPerson, Boolean> invitedColumn = new TableColumn<TestPerson, Boolean>("Invited"); invitedColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, Boolean>("invited")); TableColumn<TestPerson, String> nameColumn = new TableColumn<TestPerson, String>("First Name"); nameColumn.setCellValueFactory(new PropertyValueFactory<TestPerson, String>("firstName")); TableView<TestPerson> tableView = new TableView<TestPerson>(data); tableView.getColumns().setAll(invitedColumn, nameColumn); // set the cell factory in the invited TableColumn invitedColumn.setCellFactory(CheckBoxTableCell.forTableColumn(invitedColumn)); grid.add(tableView, 0, 0); GridPane.setVgrow(tableView, Priority.ALWAYS); GridPane.setHgrow(tableView, Priority.ALWAYS); tab.setContent(grid); }
GridPane.setVgrow(label, Priority.ALWAYS); GridPane.setHgrow(label, Priority.ALWAYS);
GridPane.setVgrow(repositoryLayout, Priority.ALWAYS);
GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS);