grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(20, 150, 10, 10));
details.setHgap(10); details.setVgap(10); details.setPadding(new Insets(24)); details.setMinSize(GridPane.USE_PREF_SIZE, GridPane.USE_PREF_SIZE);
CornerRadii.EMPTY, Insets.EMPTY))); 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 withPadding(Insets value) { super.setPadding(value); return this; }
grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25));
public void start(Stage primaryStart) throws Exception{ window = primaryStart; window.setTitle("Minesweeper (Eventually)"); //GridPane with 10px padding around edge GridPane grid = new GridPane(); grid.setPadding(new Insets(10, 10, 10, 10)); for(int i = 0; i < 5; i++){ for(int j = 0; j<5; j++){ Button button = new Button("[]"); button.setOnAction(e -> {System.out.println("Something");}); GridPane.setConstraints(button, i,j); grid.getChildren().add(button); } } Scene scene = new Scene(grid, 300, 200); window.setScene(scene); window.show(); }
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 void start(Stage stage) { GridPane grid = new GridPane(); grid.setPadding(new Insets(BUTTON_PADDING)); grid.setHgap(BUTTON_PADDING); grid.setVgap(BUTTON_PADDING);
grid.setHgap(10); grid.setVgap(10); grid.setPadding(new Insets(25, 25, 25, 25));
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);
/** * @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 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 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); }
private void buildTreeViewTab(Tab tab) { GridPane grid = new GridPane(); grid.setPadding(new Insets(5, 5, 5, 5)); grid.setHgap(5); grid.setVgap(5);