Search in sources :

Example 1 with FlowPane

use of javafx.scene.layout.FlowPane in project JFoenix by jfoenixadmin.

the class DatePickerDemo method start.

@Override
public void start(Stage stage) {
    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);
    DatePicker datePicker = new DatePicker();
    main.getChildren().add(datePicker);
    JFXDatePicker datePickerFX = new JFXDatePicker();
    main.getChildren().add(datePickerFX);
    datePickerFX.setPromptText("pick a date");
    JFXTimePicker blueDatePicker = new JFXTimePicker();
    blueDatePicker.setDefaultColor(Color.valueOf("#3f51b5"));
    blueDatePicker.setOverLay(true);
    main.getChildren().add(blueDatePicker);
    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");
    final Scene scene = new Scene(pane, 400, 700);
    scene.getStylesheets().add(MainDemo.class.getResource("/resources/css/jfoenix-fonts.css").toExternalForm());
    scene.getStylesheets().add(MainDemo.class.getResource("/resources/css/jfoenix-design.css").toExternalForm());
    stage.setTitle("JFX Date Picker Demo");
    stage.setScene(scene);
    stage.show();
}
Also used : JFXDatePicker(com.jfoenix.controls.JFXDatePicker) Insets(javafx.geometry.Insets) FlowPane(javafx.scene.layout.FlowPane) DatePicker(javafx.scene.control.DatePicker) JFXDatePicker(com.jfoenix.controls.JFXDatePicker) Scene(javafx.scene.Scene) JFXTimePicker(com.jfoenix.controls.JFXTimePicker) StackPane(javafx.scene.layout.StackPane)

Example 2 with FlowPane

use of javafx.scene.layout.FlowPane in project JFoenix by jfoenixadmin.

the class DrawerDemo method start.

@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();
}
Also used : JFXDrawer(com.jfoenix.controls.JFXDrawer) FlowPane(javafx.scene.layout.FlowPane) JFXButton(com.jfoenix.controls.JFXButton) JFXDrawersStack(com.jfoenix.controls.JFXDrawersStack) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 3 with FlowPane

use of javafx.scene.layout.FlowPane in project JFoenix by jfoenixadmin.

the class RipplerDemo method start.

@Override
public void start(Stage stage) {
    //TODO drop shadow changes the width and hegith thus need to be considered
    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);
    Label l = new Label("Click Me");
    l.setStyle("-fx-background-color:WHITE;");
    l.setPadding(new Insets(20));
    JFXRippler lrippler = new JFXRippler(l);
    lrippler.setEnabled(false);
    main.getChildren().add(lrippler);
    l.setOnMousePressed((e) -> {
        if (i == 5)
            step = -1;
        else if (i == 0)
            step = 1;
        JFXDepthManager.setDepth(l, i += step % JFXDepthManager.getLevels());
    });
    Label l1 = new Label("TEST");
    l1.setStyle("-fx-background-color:WHITE;");
    l1.setPadding(new Insets(20));
    JFXRippler rippler1 = new JFXRippler(l1);
    main.getChildren().add(rippler1);
    JFXDepthManager.setDepth(rippler1, 1);
    Label l2 = new Label("TEST1");
    l2.setStyle("-fx-background-color:WHITE;");
    l2.setPadding(new Insets(20));
    JFXRippler rippler2 = new JFXRippler(l2);
    main.getChildren().add(rippler2);
    JFXDepthManager.setDepth(rippler2, 2);
    Label l3 = new Label("TEST2");
    l3.setStyle("-fx-background-color:WHITE;");
    l3.setPadding(new Insets(20));
    JFXRippler rippler3 = new JFXRippler(l3);
    main.getChildren().add(rippler3);
    JFXDepthManager.setDepth(rippler3, 3);
    Label l4 = new Label("TEST3");
    l4.setStyle("-fx-background-color:WHITE;");
    l4.setPadding(new Insets(20));
    JFXRippler rippler4 = new JFXRippler(l4);
    main.getChildren().add(rippler4);
    JFXDepthManager.setDepth(rippler4, 4);
    Label l5 = new Label("TEST4");
    l5.setStyle("-fx-background-color:WHITE;");
    l5.setPadding(new Insets(20));
    JFXRippler rippler5 = new JFXRippler(l5);
    main.getChildren().add(rippler5);
    JFXDepthManager.setDepth(rippler5, 5);
    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");
    final Scene scene = new Scene(pane, 600, 400);
    stage.setTitle("JavaFX Ripple effect and shadows ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) JFXRippler(com.jfoenix.controls.JFXRippler) Label(javafx.scene.control.Label) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 4 with FlowPane

use of javafx.scene.layout.FlowPane in project JFoenix by jfoenixadmin.

the class ButtonDemo method start.

@Override
public void start(Stage stage) {
    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);
    main.getChildren().add(new Button("Java Button"));
    JFXButton jfoenixButton = new JFXButton("JFoenix Button");
    main.getChildren().add(jfoenixButton);
    JFXButton button = new JFXButton("Raised Button".toUpperCase());
    button.getStyleClass().add("button-raised");
    main.getChildren().add(button);
    JFXButton button1 = new JFXButton("DISABLED");
    button1.setDisable(true);
    main.getChildren().add(button1);
    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");
    final Scene scene = new Scene(pane, 800, 200);
    scene.getStylesheets().add(ButtonDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX Button Demo");
    stage.setScene(scene);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) Button(javafx.scene.control.Button) JFXButton(com.jfoenix.controls.JFXButton) FlowPane(javafx.scene.layout.FlowPane) JFXButton(com.jfoenix.controls.JFXButton) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 5 with FlowPane

use of javafx.scene.layout.FlowPane in project JFoenix by jfoenixadmin.

the class CheckBoxDemo method start.

@Override
public void start(Stage stage) {
    FlowPane main = new FlowPane();
    main.setVgap(20);
    main.setHgap(20);
    CheckBox cb = new CheckBox("CheckBox");
    JFXCheckBox jfxCheckBox = new JFXCheckBox("JFX CheckBox");
    JFXCheckBox customJFXCheckBox = new JFXCheckBox("JFX CheckBox");
    customJFXCheckBox.getStyleClass().add("custom-jfx-check-box");
    main.getChildren().add(cb);
    main.getChildren().add(jfxCheckBox);
    main.getChildren().add(customJFXCheckBox);
    StackPane pane = new StackPane();
    pane.getChildren().add(main);
    StackPane.setMargin(main, new Insets(100));
    pane.setStyle("-fx-background-color:WHITE");
    final Scene scene = new Scene(pane, 600, 200);
    scene.getStylesheets().add(CheckBoxDemo.class.getResource("/resources/css/jfoenix-components.css").toExternalForm());
    stage.setTitle("JFX CheckBox Demo ");
    stage.setScene(scene);
    stage.setResizable(false);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) JFXCheckBox(com.jfoenix.controls.JFXCheckBox) JFXCheckBox(com.jfoenix.controls.JFXCheckBox) CheckBox(javafx.scene.control.CheckBox) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

FlowPane (javafx.scene.layout.FlowPane)14 Insets (javafx.geometry.Insets)12 Scene (javafx.scene.Scene)11 StackPane (javafx.scene.layout.StackPane)8 Label (javafx.scene.control.Label)4 JFXButton (com.jfoenix.controls.JFXButton)2 JFXHamburger (com.jfoenix.controls.JFXHamburger)2 HamburgerBackArrowBasicTransition (com.jfoenix.transitions.hamburger.HamburgerBackArrowBasicTransition)2 Button (javafx.scene.control.Button)2 CheckBox (javafx.scene.control.CheckBox)2 Pane (javafx.scene.layout.Pane)2 JFXNodesAnimation (com.jfoenix.animation.JFXNodesAnimation)1 JFXCheckBox (com.jfoenix.controls.JFXCheckBox)1 JFXColorPicker (com.jfoenix.controls.JFXColorPicker)1 JFXDatePicker (com.jfoenix.controls.JFXDatePicker)1 JFXDrawer (com.jfoenix.controls.JFXDrawer)1 JFXDrawersStack (com.jfoenix.controls.JFXDrawersStack)1 JFXRippler (com.jfoenix.controls.JFXRippler)1 JFXTimePicker (com.jfoenix.controls.JFXTimePicker)1 TextFieldEditorBuilder (com.jfoenix.controls.cells.editors.TextFieldEditorBuilder)1