本文整理汇总了Java中javafx.scene.layout.BorderPane.setPrefSize方法的典型用法代码示例。如果您正苦于以下问题:Java BorderPane.setPrefSize方法的具体用法?Java BorderPane.setPrefSize怎么用?Java BorderPane.setPrefSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.BorderPane
的用法示例。
在下文中一共展示了BorderPane.setPrefSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createIconContent
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
public static Node createIconContent() {
StackPane sp = new StackPane();
BorderPane borderPane = new BorderPane();
Rectangle rectangle = new Rectangle(62, 62, Color.LIGHTGREY);
rectangle.setStroke(Color.BLACK);
borderPane.setPrefSize(rectangle.getWidth(), rectangle.getHeight());
Rectangle recTop = new Rectangle(62, 5, Color.web("#349b00"));
recTop.setStroke(Color.BLACK);
Rectangle recBottom = new Rectangle(62, 14, Color.web("#349b00"));
recBottom.setStroke(Color.BLACK);
Rectangle recLeft = new Rectangle(20, 41, Color.TRANSPARENT);
recLeft.setStroke(Color.BLACK);
Rectangle recRight = new Rectangle(20, 41, Color.TRANSPARENT);
recRight.setStroke(Color.BLACK);
Rectangle centerRight = new Rectangle(20, 41, Color.TRANSPARENT);
centerRight.setStroke(Color.BLACK);
borderPane.setRight(recRight);
borderPane.setTop(recTop);
borderPane.setLeft(recLeft);
borderPane.setBottom(recBottom);
borderPane.setCenter(centerRight);
sp.getChildren().addAll(rectangle, borderPane);
return new Group(sp);
}
示例2: getContentPane
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override protected Parent getContentPane() {
BorderPane borderPane = new BorderPane();
borderPane.setCenter(imagePanel);
borderPane.setBottom(buttonBar);
Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
borderPane.setPrefSize(visualBounds.getWidth() * 0.75, visualBounds.getHeight() * 0.75);
return borderPane;
}
示例3: getContentPane
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override protected Parent getContentPane() {
BorderPane content = new BorderPane();
content.getStyleClass().add("function-stage");
content.setId("functionStage");
content.setCenter(mainSplitPane);
content.setBottom(buttonBar);
content.setPrefSize(700, 500);
return content;
}
示例4: getContentPane
import javafx.scene.layout.BorderPane; //导入方法依赖的package包/类
@Override protected Parent getContentPane() {
BorderPane pane = new BorderPane();
pane.setCenter(splitPane);
pane.setBottom(buttonBar);
pane.setPrefSize(750, 600);
return pane;
}