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


Java JFXDrawer.setSidePane方法代码示例

本文整理汇总了Java中com.jfoenix.controls.JFXDrawer.setSidePane方法的典型用法代码示例。如果您正苦于以下问题:Java JFXDrawer.setSidePane方法的具体用法?Java JFXDrawer.setSidePane怎么用?Java JFXDrawer.setSidePane使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jfoenix.controls.JFXDrawer的用法示例。


在下文中一共展示了JFXDrawer.setSidePane方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import com.jfoenix.controls.JFXDrawer; //导入方法依赖的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

示例2: start

import com.jfoenix.controls.JFXDrawer; //导入方法依赖的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


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