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();
}
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();
}
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);
}
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();
}
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();
}
Aggregations