grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(20, 150, 10, 10));
GlyphDetailViewer() { GridPane details = new GridPane(); details.setHgap(10); details.setVgap(10); details.setPadding(new Insets(24));
contentGrid.setPadding(new Insets(0, 12, 12, 12)); contentGrid.setVgap(0); contentGrid.setHgap(0);
ctrls.setHgap(5); ctrls.setVgap(5); ctrls.setPadding(new Insets(10));
/** * * @param value * @return */ public GridPane withHGap(double value) { super.setHgap(value); return this; }
grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25));
GridPane graphicGrid = new GridPane(); graphicGrid.setHgap(5); graphicGrid.setVgap(5); // Create an icon using FontAwesomeFX. Text icon = GlyphsDude.createIcon(FontAwesomeIcon.ARROW_RIGHT); icon.setFill(Color.GREEN); Label headerLabel = new Label("Go to the Circus"); headerLabel.setStyle("-fx-font-size: 1.5em;"); Label detailsLabel = new Label("Watch acrobats fly around and clowns, of course."); graphicGrid.add(icon, 0, 0); graphicGrid.add(headerLabel, 1, 0); graphicGrid.add(detailsLabel, 1, 1); Button button = new Button("", graphicGrid);
GridPane gridPane = new GridPane(); gridPane.setPadding(new Insets(10)); gridPane.setHgap(5); gridPane.setVgap(5); gridPane.add(gridCircles, 0, 0); gridPane.add(gridClock, 1, 0); gridPane.add(gridHangMan, 2, 0); Scene scene = new Scene(gridPane, 1500, 500); primoStage.setTitle("Assignment 6 Test"); primoStage.setScene(scene); primoStage.show();
@Override public void start(Stage stage) { GridPane grid = new GridPane(); grid.setPadding(new Insets(BUTTON_PADDING)); grid.setHgap(BUTTON_PADDING); grid.setVgap(BUTTON_PADDING); for (int r = 0; r < NUM_BUTTON_LINES; r++) { for (int c = 0; c < BUTTONS_PER_LINE; c++) { int number = NUM_BUTTON_LINES * r + c; Button button = new Button(String.valueOf(number)); grid.add(button, c, r); } } ScrollPane scrollPane = new ScrollPane(grid); stage.setScene(new Scene(scrollPane)); stage.show(); }
GridPane grid = new GridPane(); grid.setHgap(10); grid.setVgap(10); final Text infoText = new Text(); grid.setPadding(new Insets(10, 10, 10, 10)); grid.add(infoText, 0, 4, 2, 1); final Dialog dlg = new Dialog(null, "dialog"); dlg.setContent(grid); dlg.show();
ScalableContentPane scale = new ScalableContentPane(); GridPane gridPane = new GridPane(); gridPane.setPadding(new Insets(10)); gridPane.setHgap(5); gridPane.setVgap(5); gridPane.add(gridCircles, 0, 0); gridPane.add(gridClock, 1, 0); gridPane.add(gridHangMan, 2, 0); scale.setContent(gridPane); Scene scene = new Scene(scale, 1650, 500); primoStage.setTitle("Assignment 6 Test"); primoStage.setScene(scene); primoStage.show();
GridPane grid = new GridPane(); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(10, 10, 10, 10)); ImageView customImage = new ImageView(new Image("/home/mani/Desktop/img.jpg", 100, 80, false, true)); grid.add(customImage, 0, 0); // make a dialog final Dialog dlg = new Dialog(null, "myDailog-with-Image"); // Add grid inside dialog. dlg.setContent(grid); dlg.show();
private GridPane createGrid() { GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25)); return grid; } }
public Pane toPane() { GridPane pane = new GridPane(); pane.setHgap(5); ColumnConstraints column0 = new ColumnConstraints(); ColumnConstraints column1 = new ColumnConstraints(); column1.setHgrow(Priority.ALWAYS); pane.getColumnConstraints().addAll(column0, column1); pane.add(label, 0, 0); pane.add(textField, 1, 0); pane.add(button, 2, 0); return pane; }
GridPane root = new GridPane(); root.setAlignment(Pos.TOP_LEFT); root.setHgap(10); root.setVgap(10); root.setPadding(new Insets(50, 50, 50, 50)); //Add each element to the GridPane //.add(element, column, row ,column span, row span) span must be >0 //row 0 root.add(sourceDirLabel, 0, 0, 2, 1); //row1 root.add(sourceDirText,0, 1, 3, 1); root.add(sourceDirBtn, 3, 1); //row 2 root.add(outputDirLabel, 0, 2, 2, 1); //row3 root.add(outputDirText,0, 3, 3, 1); root.add(outputDirBtn, 3, 3); //row4 root.add(runBtn, 0 , 4);
Dialog dialogQtPrescription = new Dialog(); dialogQtPrescription.setTitle("yourTitle"); dialogQtPrescription.setHeaderText("yourHeadertext"); dialogQtPrescription.initModality(Modality.WINDOW_MODAL); dialogQtPrescription.initOwner(mainStage); dialogQtPrescription.initStyle(StageStyle.UTILITY); GridPane gridDialogPrescription = new GridPane(); gridDialogPrescription.setHgap(10); gridDialogPrescription.setVgap(10); gridDialogPrescription.add(new Label(bundle.getString("quantityPrescription.title")), 0, 0); TextField txtQtPrescr = new TextField(); ButtonType buttonTypeNo = new ButtonType("no"); ButtonType buttonTypeYes = new ButtonType("yes"); ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE); dialogQtPrescription.getDialogPane().getButtonTypes().addAll(buttonTypeNo,buttonTypeYes, buttonTypeCancel); txtQtPrescr.setPrefWidth(100); gridDialogPrescription.add(txtQtPrescr, 1, 0); dialogQtPrescription.getDialogPane().setContent(gridDialogPrescription); Optional<ButtonType> result = dialogQtPrescription.showAndWait();
/** * @return menu content containing input mappings (action -> key/mouse) */ protected final MenuContent createContentControls() { log.debug("createContentControls()"); GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(10, 10, 10, 10)); grid.getColumnConstraints().add(new ColumnConstraints(200, 200, 200, Priority.ALWAYS, HPos.LEFT, true)); grid.getRowConstraints().add(new RowConstraints(40, 40, 40, Priority.ALWAYS, VPos.CENTER, true)); // row 0 grid.setUserData(0); forEach(app.getInput().getBindings(), (action, trigger) -> addNewInputBinding(action, trigger, grid)); ScrollPane scroll = new FXGLScrollPane(grid); scroll.setVbarPolicy(ScrollBarPolicy.ALWAYS); scroll.setMaxHeight(app.getHeight() / 2.5); HBox hbox = new HBox(scroll); hbox.setAlignment(Pos.CENTER); return new MenuContent(hbox); }
private void populateRepositoryRefresh() { // Refresh Repositories this.refreshLayout = new GridPane(); this.refreshLayout.setHgap(20); this.refreshLayout.setVgap(10); this.refreshRepositoriesLabel = new Label( tr("Fetch updates from the repositories to retrieve latest script versions")); this.refreshRepositoriesLabel.setWrapText(true); this.refreshRepositoriesButton = new Button(tr("Refresh Repositories")); this.refreshRepositoriesButton.setOnAction(event -> { this.vBox.setDisable(true); this.overlay.toFront(); repositoryManager.triggerRepositoryChange(); }); this.refreshLayout.add(refreshRepositoriesLabel, 0, 0); this.refreshLayout.add(refreshRepositoriesButton, 1, 0); GridPane.setHgrow(refreshRepositoriesLabel, Priority.ALWAYS); }
GridPane gridPane = new GridPane(); gridPane.setHgap(10); gridPane.setVgap(10); ColumnConstraints c1 = new ColumnConstraints(); c1.setHalignment(HPos.RIGHT); c1.setHgrow(Priority.NEVER); ColumnConstraints c2 = new ColumnConstraints(); c2.setHgrow(Priority.ALWAYS); c2.setFillWidth(true); ColumnConstraints c3 = new ColumnConstraints(); c3.setHalignment(HPos.RIGHT); c3.setHgrow(Priority.NEVER); ColumnConstraints c4 = new ColumnConstraints(); c4.setHgrow(Priority.ALWAYS); c4.setFillWidth(true); gridPane.getColumnConstraints().addAll(c1,c2,c3,c4);
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); }