当前位置: 首页>>代码示例>>Java>>正文


Java FlowPane.setMaxSize方法代码示例

本文整理汇总了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");
}
 
开发者ID:SKNZ,项目名称:LesPatternsDuSwag,代码行数:37,代码来源:VehicleStage.java

示例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");
}
 
开发者ID:SKNZ,项目名称:LesPatternsDuSwag,代码行数:40,代码来源:InvoiceStage.java

示例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();
}
 
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:81,代码来源:DrawerDemo.java

示例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();
}
 
开发者ID:ntenhoeve,项目名称:Introspect-Framework,代码行数:75,代码来源:RfxDrawerTest.java


注:本文中的javafx.scene.layout.FlowPane.setMaxSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。