本文整理汇总了Java中javafx.scene.layout.FlowPane.setMaxSize方法的典型用法代码示例。如果您正苦于以下问题:Java FlowPane.setMaxSize方法的具体用法?Java FlowPane.setMaxSize怎么用?Java FlowPane.setMaxSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.layout.FlowPane
的用法示例。
在下文中一共展示了FlowPane.setMaxSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VehicleStage
import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
public VehicleStage(Window owner) {
this.initOwner(owner);
init();
BorderPane borderPane = new BorderPane();
FlowPane flowPane = new FlowPane();
//add Nodes to FlowPane
flowPane.getChildren().addAll(
titleLabel,
vehicleChoiceBox,
plateField,
brandField,
modelField,
clientChoiceBox,
submitButton,
cancelButton
);
flowPane.setMaxSize(200, 400);
//add FlowPane
flowPane.alignmentProperty().setValue(Pos.CENTER);
borderPane.setCenter(flowPane);
//add Label error
borderPane.setBottom(label);
BorderPane.setAlignment(label, Pos.CENTER);
//create scene
Scene scene = new Scene(borderPane, 300, 200);
setResizable(false);
setScene(scene);
setTitle("New Vehicle");
}
示例2: InvoiceStage
import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
public InvoiceStage(Window owner, ParkingSpot parkingSpot, Invoice invoice) {
this.initOwner(owner);
this.parkingSpot = parkingSpot;
this.invoice = invoice;
init();
BorderPane borderPane = new BorderPane();
FlowPane flowPane = new FlowPane();
//add Nodes to FlowPane
flowPane.getChildren().addAll(
title,
invoiceNumber,
price,
info,
choice,
radioButtonTypeChoiceHTML,
radioButtonTypeChoiceMarkdown,
uploadCheckBox,
languageChoiceLabel,
radioButtonLanguageEnglish,
radioButtonLanguageFrench,
ok
);
flowPane.setMaxSize(200, 400);
//add FlowPane
flowPane.alignmentProperty().setValue(Pos.CENTER);
borderPane.setCenter(flowPane);
//create scene
Scene scene = new Scene(borderPane, 300, 200);
this.setResizable(false);
this.setScene(scene);
this.setTitle("Invoice");
}
示例3: start
import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
@Override
public void start(Stage stage) {
FlowPane content = new FlowPane();
JFXButton leftButton = new JFXButton(LEFT);
JFXButton topButton = new JFXButton(TOP);
JFXButton rightButton = new JFXButton(RIGHT);
JFXButton bottomButton = new JFXButton(BOTTOM);
content.getChildren().addAll(leftButton, topButton, rightButton, bottomButton);
content.setMaxSize(200, 200);
JFXDrawer leftDrawer = new JFXDrawer();
StackPane leftDrawerPane = new StackPane();
leftDrawerPane.getStyleClass().add("red-400");
leftDrawerPane.getChildren().add(new JFXButton("Left Content"));
leftDrawer.setSidePane(leftDrawerPane);
leftDrawer.setDefaultDrawerSize(150);
leftDrawer.setResizeContent(true);
leftDrawer.setOverLayVisible(false);
leftDrawer.setResizableOnDrag(true);
JFXDrawer bottomDrawer = new JFXDrawer();
StackPane bottomDrawerPane = new StackPane();
bottomDrawerPane.getStyleClass().add("deep-purple-400");
bottomDrawerPane.getChildren().add(new JFXButton("Bottom Content"));
bottomDrawer.setDefaultDrawerSize(150);
bottomDrawer.setDirection(DrawerDirection.BOTTOM);
bottomDrawer.setSidePane(bottomDrawerPane);
bottomDrawer.setResizeContent(true);
bottomDrawer.setOverLayVisible(false);
bottomDrawer.setResizableOnDrag(true);
JFXDrawer rightDrawer = new JFXDrawer();
StackPane rightDrawerPane = new StackPane();
rightDrawerPane.getStyleClass().add("blue-400");
rightDrawerPane.getChildren().add(new JFXButton("Right Content"));
rightDrawer.setDirection(DrawerDirection.RIGHT);
rightDrawer.setDefaultDrawerSize(150);
rightDrawer.setSidePane(rightDrawerPane);
rightDrawer.setOverLayVisible(false);
rightDrawer.setResizableOnDrag(true);
JFXDrawer topDrawer = new JFXDrawer();
StackPane topDrawerPane = new StackPane();
topDrawerPane.getStyleClass().add("green-400");
topDrawerPane.getChildren().add(new JFXButton("Top Content"));
topDrawer.setDirection(DrawerDirection.TOP);
topDrawer.setDefaultDrawerSize(150);
topDrawer.setSidePane(topDrawerPane);
topDrawer.setOverLayVisible(false);
topDrawer.setResizableOnDrag(true);
JFXDrawersStack drawersStack = new JFXDrawersStack();
drawersStack.setContent(content);
leftDrawer.setId(LEFT);
rightDrawer.setId(RIGHT);
bottomDrawer.setId(BOTTOM);
topDrawer.setId(TOP);
leftButton.addEventHandler(MOUSE_PRESSED, e -> drawersStack.toggle(leftDrawer));
bottomButton.addEventHandler(MOUSE_PRESSED, e -> drawersStack.toggle(bottomDrawer));
rightButton.addEventHandler(MOUSE_PRESSED, e -> drawersStack.toggle(rightDrawer));
topButton.addEventHandler(MOUSE_PRESSED, e -> drawersStack.toggle(topDrawer));
final Scene scene = new Scene(drawersStack, 800, 800);
final ObservableList<String> stylesheets = scene.getStylesheets();
stylesheets.addAll(DrawerDemo.class.getResource("/css/jfoenix-components.css").toExternalForm(),
DrawerDemo.class.getResource("/css/jfoenix-design.css").toExternalForm());
stage.setTitle("JFX Drawer Demo");
stage.setScene(scene);
stage.setResizable(true);
stage.show();
}
示例4: start
import javafx.scene.layout.FlowPane; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
FlowPane content = new FlowPane();
JFXButton leftButton = new JFXButton("LEFT");
JFXButton topButton = new JFXButton("TOP");
JFXButton rightButton = new JFXButton("RIGHT");
JFXButton bottomButton = new JFXButton("BOTTOM");
content.getChildren().addAll(leftButton, topButton, rightButton, bottomButton);
content.setMaxSize(200, 200);
JFXDrawer leftDrawer = new JFXDrawer();
StackPane leftDrawerPane = new StackPane();
leftDrawerPane.getStyleClass().add("red-400");
leftDrawerPane.getChildren().add(new JFXButton("Left Content"));
leftDrawer.setSidePane(leftDrawerPane);
leftDrawer.setDefaultDrawerSize(150);
// leftDrawer.setContent(content);
leftDrawer.setOverLayVisible(false);
leftDrawer.setResizableOnDrag(true);
JFXDrawer bottomDrawer = new JFXDrawer();
StackPane bottomDrawerPane = new StackPane();
bottomDrawerPane.getStyleClass().add("deep-purple-400");
bottomDrawerPane.getChildren().add(new JFXButton("Bottom Content"));
bottomDrawer.setDefaultDrawerSize(150);
bottomDrawer.setDirection(DrawerDirection.BOTTOM);
bottomDrawer.setSidePane(bottomDrawerPane);
// bottomDrawer.setContent(leftDrawer);
bottomDrawer.setOverLayVisible(false);
bottomDrawer.setResizableOnDrag(true);
JFXDrawer rightDrawer = new JFXDrawer();
StackPane rightDrawerPane = new StackPane();
rightDrawerPane.getStyleClass().add("blue-400");
rightDrawerPane.getChildren().add(new JFXButton("Right Content"));
rightDrawer.setDirection(DrawerDirection.RIGHT);
rightDrawer.setDefaultDrawerSize(150);
rightDrawer.setSidePane(rightDrawerPane);
// rightDrawer.setContent(bottomDrawer);
rightDrawer.setOverLayVisible(false);
rightDrawer.setResizableOnDrag(true);
JFXDrawer topDrawer = new JFXDrawer();
StackPane topDrawerPane = new StackPane();
topDrawerPane.getStyleClass().add("green-400");
topDrawerPane.getChildren().add(new JFXButton("Top Content"));
topDrawer.setDirection(DrawerDirection.TOP);
topDrawer.setDefaultDrawerSize(150);
topDrawer.setSidePane(topDrawerPane);
// topDrawer.setContent(rightDrawer);
topDrawer.setOverLayVisible(false);
topDrawer.setResizableOnDrag(true);
JFXDrawersStack drawersStack = new JFXDrawersStack();
drawersStack.setContent(content);
leftDrawer.setId("LEFT");
rightDrawer.setId("RIGHT");
bottomDrawer.setId("BOT");
topDrawer.setId("TOP");
leftButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
drawersStack.toggle(leftDrawer);
});
bottomButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
drawersStack.toggle(bottomDrawer);
});
rightButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
drawersStack.toggle(rightDrawer);
});
topButton.addEventHandler(MouseEvent.MOUSE_PRESSED, (e) -> {
drawersStack.toggle(topDrawer);
});
final Scene scene = new Scene(drawersStack, 800, 800);
// scene.getStylesheets().add(DrawerDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
// scene.getStylesheets().add(DrawerDemo.class.getResource("/resources/css/jfoenix-design.css").toExternalForm());
primaryStage.setTitle("JFX Drawer Demo");
primaryStage.setScene(scene);
primaryStage.setResizable(true);
primaryStage.show();
}