Search in sources :

Example 11 with StackPane

use of javafx.scene.layout.StackPane 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 12 with StackPane

use of javafx.scene.layout.StackPane 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)

Example 13 with StackPane

use of javafx.scene.layout.StackPane in project fxexperience2 by EricCanull.

the class MainController method initialize.

/**
     * Initializes the controller class.
     *
     * @param url
     * @param rb
     */
@Override
public void initialize(URL url, ResourceBundle rb) {
    loadTool(AppPaths.STYLER_ID, AppPaths.STYLER_FXML_PATH);
    loadTool(AppPaths.SPLINE_ID, AppPaths.SPLINE_FXML_PATH);
    loadTool(AppPaths.DERIVED_ID, AppPaths.DERIVED_FXML_PATH);
    initToggleGroup();
    currentPane = new StackPane();
    currentPane.getChildren().add(screens.get(AppPaths.STYLER_ID));
    sparePane = new StackPane();
    sparePane.setVisible(false);
    rootContainer.getChildren().addAll(currentPane, sparePane);
}
Also used : StackPane(javafx.scene.layout.StackPane)

Example 14 with StackPane

use of javafx.scene.layout.StackPane in project mastering-java by Kingminghuang.

the class FlashText method start.

@Override
public void start(Stage primaryStage) throws Exception {
    StackPane stackPane = new StackPane();
    Label label = new Label("Talk is cheap, show me the code");
    label.setStyle("-fx-font-size: 20");
    label.setStyle("-fx-color: blue");
    stackPane.getChildren().add(label);
    new Thread(() -> {
        try {
            while (true) {
                if (label.getText().trim().length() == 0) {
                    text = "Welcome";
                } else {
                    text = "";
                }
                Platform.runLater(() -> label.setText(text));
                Thread.sleep(200);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }).start();
    Scene scene = new Scene(stackPane, 200, 100);
    primaryStage.setTitle("Flash Text");
    primaryStage.setScene(scene);
    primaryStage.show();
}
Also used : Label(javafx.scene.control.Label) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Example 15 with StackPane

use of javafx.scene.layout.StackPane in project Smartcity-Smarthouse by TechnionYP5777.

the class SosSensorSimulator method start.

@Override
public void start(final Stage s) throws Exception {
    sensor = new SosSensor(Random.sensorId(), 40001);
    for (boolean res = false; !res; ) res = sensor.register();
    final Image sosImage = new Image(getClass().getResourceAsStream("/sensors/sos/sos_icon.png"), 320, 0, true, true);
    final Button sosButton = new Button();
    sosButton.setId("sosButton");
    sosButton.setGraphic(new ImageView(sosImage));
    sosButton.setStyle("-fx-focus-color: transparent;");
    sosButton.setOnAction(event -> sensor.updateSystem());
    final StackPane layout = new StackPane();
    layout.getChildren().add(sosButton);
    s.setScene(new Scene(layout, 320, 268));
    s.setTitle("SOS Sensor Simulator");
    s.show();
}
Also used : SosSensor(il.ac.technion.cs.smarthouse.sensors.sos.SosSensor) Button(javafx.scene.control.Button) ImageView(javafx.scene.image.ImageView) Image(javafx.scene.image.Image) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

StackPane (javafx.scene.layout.StackPane)63 Scene (javafx.scene.Scene)34 Insets (javafx.geometry.Insets)15 BorderPane (javafx.scene.layout.BorderPane)12 Label (javafx.scene.control.Label)9 Parameter (aima.gui.fx.framework.Parameter)8 SimulationPaneBuilder (aima.gui.fx.framework.SimulationPaneBuilder)8 FlowPane (javafx.scene.layout.FlowPane)8 VBox (javafx.scene.layout.VBox)6 JFXButton (com.jfoenix.controls.JFXButton)5 Group (javafx.scene.Group)5 MapPaneCtrl (aimax.osm.gui.fx.viewer.MapPaneCtrl)4 ArrayList (java.util.ArrayList)4 Platform (javafx.application.Platform)4 Node (javafx.scene.Node)4 Button (javafx.scene.control.Button)4 Color (javafx.scene.paint.Color)4 WebView (javafx.scene.web.WebView)4 JFXHamburger (com.jfoenix.controls.JFXHamburger)3 JFXTextField (com.jfoenix.controls.JFXTextField)3