Refine search
ValidationDemo.class.getResource("context.css") .toExternalForm()); stage.setScene(scene); stage.show(); GridPane grid = new GridPane(); grid.setAlignment(Pos.CENTER); grid.setHgap(10); grid.add(scenetitle, 0, 0, 2, 1); grid.add(userName, 0, 1); grid.add(userTextField, 1, 1); grid.add(pw, 0, 2); grid.add(pwBox, 1, 2); hbBtn.setAlignment(Pos.BOTTOM_RIGHT); hbBtn.getChildren().add(btn); grid.add(hbBtn, 1, 4); grid.add(actiontarget, 1, 6);
Canvas canvas = new Canvas(); canvas.setHeight(300); canvas.setWidth(300); ScrollBar vScroll = createScrollBar(Orientation.VERTICAL, 10000, 300); ScrollBar hScroll = createScrollBar(Orientation.HORIZONTAL, 10000, 300); GridPane scrollPane = new GridPane(); scrollPane.addColumn(0, canvas, hScroll); scrollPane.add(vScroll, 1, 0);
import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Label; import javafx.scene.control.Slider; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; import javafx.stage.Stage; public class SliderInGridPane extends Application { @Override public void start(Stage primaryStage) { GridPane root = new GridPane(); root.add(new Label("Value:"), 0, 0); Slider slider = new Slider(0, 100, 50); GridPane.setHgrow(slider, Priority.ALWAYS); root.add(slider, 1, 0); primaryStage.setScene(new Scene(root, 250, 75)); primaryStage.show(); } public static void main(String[] args) { launch(args); } }
pane.getButtonTypes().addAll(ButtonType.CANCEL, authButtonType); final GridPane grid = new GridPane(); grid.setHgap(10); grid.setVgap(10); password.setPromptText("Password"); grid.add(new Label("Username:"), 0, 0); grid.add(username, 1, 0); grid.add(new Label("Password:"), 0, 1); grid.add(password, 1, 1);
public class Test extends Application { public void start(final Stage stage) throws Exception { final GridPane grid = new GridPane(); grid.getColumnConstraints().setAll( ColumnConstraintsBuilder.create().percentWidth(100/3.0).build(), ColumnConstraintsBuilder.create().percentWidth(100/3.0).build(), ColumnConstraintsBuilder.create().percentWidth(100/3.0).build() ); grid.add(new Button("One"),0,0); grid.add(new Button("Two"),1,0); grid.add(new Button("and three"),2,0); stage.setScene(new Scene(grid)); stage.show(); } public static void main(String[] args) { Application.launch(args); } }
add(helpIcon(i18n.i18n("Set the module to open at application startup (restart needed)")), 2, 1); GridPane statsPane = new GridPane(); statsPane.add(clearStatsButton, 0, 0); statsPane.add( helpIcon(i18n .i18n("Usage statistics are used to populate the modules quick bar on the left with the most used and most recently used modules.")),
normalize.setId("normalizeCheck"); GridPane options = new GridPane(); acroForms.getItems().add(keyValue(AcroFormPolicy.DISCARD, i18n.i18n("Discard forms"))); acroForms.setId("acroFormsCombo"); options.add(new Label(i18n.i18n("Interactive forms (AcroForms):")), 0, 0); acroForms.setMaxWidth(Double.POSITIVE_INFINITY); options.add(acroForms, 1, 0); options.add(helpIcon(i18n.i18n("What to do in case one or more input documents contain Acro Forms")), 2, 0); options.add(new Label(i18n.i18n("Bookmarks handling:")), 0, 1); outline.setMaxWidth(Double.POSITIVE_INFINITY); options.add(outline, 1, 1); options.add(helpIcon(i18n.i18n("What to do in case one or more input documents contain bookmarks")), 2, 1); options.add(new Label(i18n.i18n("Table of contents:")), 0, 2); toc.setMaxWidth(Double.POSITIVE_INFINITY); options.add(toc, 1, 2); options.add(helpIcon(i18n.i18n("Set if a table of contents should be added to the generated PDF document")), 2, 2); options.getStyleClass().addAll(Style.GRID.css());
GridPane expContent = new GridPane(); //Initialize the GridPane //Add children expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); //set growth GridPane.setVgrow(exceptionTextArea, Priority.ALWAYS); GridPane.setHgrow(exceptionTextArea, Priority.ALWAYS); //Add GridPane to Alert alert.getDialogPane().setExpandableContent(expContent);
GridPane gridPane = new GridPane(); gridPane.setHgap(4); gridPane.setVgap(4); Rectangle rect = new Rectangle(15, 15, Color.hsb(x * (360d / (columns - 1)), 1, brightness)); rect.setStroke(Color.BLACK); gridPane.add(rect, x, y); Rectangle rect = new Rectangle(15, 15, Color.hsb(x * (360d / (columns - 1)), saturation, 1)); rect.setStroke(Color.BLACK); gridPane.add(rect, x, y); Rectangle rect = new Rectangle(15, 15, Color.hsb(0, 0, y / (double) maxIndex)); rect.setStroke(Color.BLACK); gridPane.add(rect, columnCount, y); primaryStage.setScene(scene); primaryStage.show();
public class MyApp extends Application { private static final String APP_NAME = "My App "; public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { TextField titleTextField = new TextField(); GridPane grid = new GridPane(); grid.add(titleTextField, 1, 1); Scene scene = new Scene(grid, 300, 275); primaryStage.setScene(scene); primaryStage.titleProperty().bind(Bindings.concat(APP_NAME).concat(titleTextField.textProperty())); primaryStage.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 root = new GridPane(); root.add((Node)(FXMLLoader.load(getClass().getResource("sample1.fxml"))) , 1 , 1); root.add((Node)(FXMLLoader.load(getClass().getResource("sample2.fxml"))) , 1 , 2); primaryStage.setTitle("Two For One Special"); primaryStage.setScene(new Scene(root, 800, 600)); primaryStage.show();