本文整理了Java中javafx.scene.layout.BorderPane.setPadding()
方法的一些代码示例,展示了BorderPane.setPadding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BorderPane.setPadding()
方法的具体详情如下:
包路径:javafx.scene.layout.BorderPane
类名称:BorderPane
方法名:setPadding
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
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;
}
代码示例来源:origin: jfoenixadmin/JFoenix
contentContainer.setCenter(contentPane);
contentContainer.setMinHeight(50);
contentContainer.setPadding(new Insets(2, 12, 2, 12));
return contentContainer;
代码示例来源:origin: jfoenixadmin/JFoenix
arrowsContainer.setLeft(backMonthButton);
arrowsContainer.setRight(forwardMonthButton);
arrowsContainer.setPadding(new Insets(4, 12, 2, 12));
arrowsContainer.setPickOnBounds(false);
return arrowsContainer;
代码示例来源:origin: stackoverflow.com
@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();
}
代码示例来源:origin: stackoverflow.com
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();
}
}
代码示例来源:origin: stackoverflow.com
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);
}}
代码示例来源:origin: stackoverflow.com
root.setPadding(new Insets(15));
代码示例来源:origin: stackoverflow.com
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();
}
代码示例来源:origin: com.jfoenix/jfoenix
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;
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs
dialogContent.getStyleClass().add("titleDialog_ContentArea"); //$NON-NLS-1$
dialogContent.setCenter(createDialogContent());
dialogContent.setPadding(new Insets(10, 10, 10, 10));
pane.getChildren().add(dialogContent);
代码示例来源:origin: stackoverflow.com
root.setPadding(new Insets(20)); // space between elements and window border
root.setCenter(vbCenter);
root.setBottom(hbButtons);
代码示例来源:origin: stackoverflow.com
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));
代码示例来源:origin: stackoverflow.com
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));
代码示例来源:origin: stackoverflow.com
root.setPadding(new Insets(10));
root.setTop(displayField);
root.setCenter(grid);
代码示例来源:origin: stackoverflow.com
root.setPadding(PADDING);
代码示例来源:origin: stackoverflow.com
settings.setPadding(new Insets(10));
代码示例来源:origin: com.jfoenix/jfoenix
contentContainer.setCenter(contentPane);
contentContainer.setMinHeight(50);
contentContainer.setPadding(new Insets(2, 12, 2, 12));
return contentContainer;
代码示例来源:origin: com.jfoenix/jfoenix
arrowsContainer.setLeft(backMonthButton);
arrowsContainer.setRight(forwardMonthButton);
arrowsContainer.setPadding(new Insets(4, 12, 2, 12));
arrowsContainer.setPickOnBounds(false);
return arrowsContainer;
代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX
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);
内容来源于网络,如有侵权,请联系作者删除!