protected BorderPane createCalendarMonthLabelPane() { monthYearLabel = new Label(); monthYearLabel.getStyleClass().add(SPINNER_LABEL); monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13)); monthYearLabel.setTextFill(DEFAULT_COLOR); BorderPane monthContainer = new BorderPane(); monthContainer.setMinHeight(50); monthContainer.setCenter(monthYearLabel); monthContainer.setPadding(new Insets(2, 12, 2, 12)); return monthContainer; }
contentContainer.setCenter(contentPane); contentContainer.setMinHeight(50); contentContainer.setPadding(new Insets(2, 12, 2, 12)); return contentContainer;
arrowsContainer.setLeft(backMonthButton); arrowsContainer.setRight(forwardMonthButton); arrowsContainer.setPadding(new Insets(4, 12, 2, 12)); arrowsContainer.setPickOnBounds(false); return arrowsContainer;
@Override public void start(Stage primaryStage) { HBox hbox = new HBox(); Button b = new Button("add"); b.setOnAction(ev -> hbox.getChildren().add(new Label("Test"))); ScrollPane scrollPane = new ScrollPane(hbox); scrollPane.setFitToHeight(true); BorderPane root = new BorderPane(scrollPane); root.setPadding(new Insets(15)); root.setTop(b); Scene scene = new Scene(root, 400, 400); primaryStage.setScene(scene); primaryStage.show(); }
public class Main extends Application { @Override public void start(Stage primaryStage) { Canvas canvas = new Canvas(0, 0); Button button = new Button("test"); button.setOnAction(ev -> { canvas.setWidth(canvas.getWidth() + 10); canvas.setHeight(canvas.getHeight() + 10); canvas.getGraphicsContext2D().clearRect(0, 0, canvas.getWidth(), canvas.getHeight()); canvas.getGraphicsContext2D().fillRect(0, 0, canvas.getWidth(), canvas.getHeight()); }); BorderPane canvasBorderPane = new BorderPane(canvas); canvasBorderPane.setPadding(new Insets(10)); canvasBorderPane.setBackground(new Background(new BackgroundFill(Color.RED, new CornerRadii(0), Insets.EMPTY))); BorderPane root = new BorderPane(canvasBorderPane); root.setPadding(new Insets(10)); root.setBackground(new Background(new BackgroundFill(Color.BLUE, new CornerRadii(0), Insets.EMPTY))); root.setBottom(button); Scene scene = new Scene(root, 400, 400); primaryStage.setScene(scene); primaryStage.show(); } }
public class MyPopUp extends Stage { public MyPopUp () { super(); this.setTitle("Pop"); this.setResizable(false); // The important part this.initModality(Modality.APPLICATION_MODAL); BorderPane borderPaneOptionPane = new BorderPane(); borderPaneOptionPane.setCenter(new TextArea()); // For example Button closeButton = new Button("Close"); closeButton.setOnAction(event -> { this.hide(); }); borderPaneOptionPane.setPadding(new Insets(5)); Scene s = new Scene(borderPaneOptionPane); this.setScene(s); }}
root.setPadding(new Insets(15));
public void start(Stage primaryStage) { ComboBox<String> combobox1 = new ComboBox<>(); ComboBox<String> combobox2 = new ComboBox<>(); combobox2.setDisable(true); combobox2.setStyle("-fx-opacity: 1;"); BorderPane root = new BorderPane(); root.setPadding(new Insets(15)); root.setTop(combobox1); root.setBottom(combobox2); Scene scene = new Scene(root, 400, 400); primaryStage.setScene(scene); primaryStage.show(); }
protected BorderPane createCalendarMonthLabelPane() { monthYearLabel = new Label(); monthYearLabel.getStyleClass().add(SPINNER_LABEL); monthYearLabel.setFont(Font.font(ROBOTO, FontWeight.BOLD, 13)); monthYearLabel.setTextFill(DEFAULT_COLOR); BorderPane monthContainer = new BorderPane(); monthContainer.setMinHeight(50); monthContainer.setCenter(monthYearLabel); monthContainer.setPadding(new Insets(2, 12, 2, 12)); return monthContainer; }
dialogContent.getStyleClass().add("titleDialog_ContentArea"); //$NON-NLS-1$ dialogContent.setCenter(createDialogContent()); dialogContent.setPadding(new Insets(10, 10, 10, 10)); pane.getChildren().add(dialogContent);
root.setPadding(new Insets(20)); // space between elements and window border root.setCenter(vbCenter); root.setBottom(hbButtons);
controls.getChildren().addAll(new Label("Some other stuff here"), new TextField(), new Button("OK")); root.setTop(controls); root.setPadding(new Insets(0, 0, 10, 40)); root.setLeft(new Circle(25, Color.SALMON));
top.setPadding(new Insets(16)); top.setBorder(red); top.setLeft(createLabel("Label 1", yellow, 16)); bot.setPadding(new Insets(16)); bot.setBorder(blue); bot.setCenter(createLabel("Label 4", Color.GREEN, 24));
root.setPadding(new Insets(10)); root.setTop(displayField); root.setCenter(grid);
root.setPadding(PADDING);
settings.setPadding(new Insets(10));
contentContainer.setCenter(contentPane); contentContainer.setMinHeight(50); contentContainer.setPadding(new Insets(2, 12, 2, 12)); return contentContainer;
arrowsContainer.setLeft(backMonthButton); arrowsContainer.setRight(forwardMonthButton); arrowsContainer.setPadding(new Insets(4, 12, 2, 12)); arrowsContainer.setPickOnBounds(false); return arrowsContainer;
PlaceHolder placeHolder = new PlaceHolder(1, contentHeight.doubleValue()); placeHolder.heightLocalProperty().bind(contentHeight); overAllLayout.setPadding(new Insets(DROP_SHADOW_PADDING)); overAllLayout.getStyleClass().add("overAllLayoutAnchorPane"); overAllLayout.setLeft(contentContainer);