本文整理匯總了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;
}