package test.scenegraph.app; import javafx.application.Application; import javafx.application.Platform; import javafx.beans.property.DoubleProperty; import javafx.scene.Scene; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.stage.Stage; public class ShortAppWithoutDependencies51 extends Application { final DoubleProperty xxx = new DoubleProperty(0); @Override public void start(Stage stage) { Pane pane = new Pane(); stage.setScene(new Scene(pane, 300, 400)); Text node1 = createText(); node1.setStroke(Color.RED); node1.setTranslateY(250); node1.setStrokeWidth(5); Text node2 = createText(); node2.setStroke(Color.DARKGREEN); node2.setTranslateY(150); node2.strokeWidthProperty().bind(xxx); pane.getChildren().add(node1); pane.getChildren().add(node2); stage.setVisible(true); Platform.runLater(new Runnable() { public void run() { try { Thread.sleep(200); } catch (InterruptedException ex) { } xxx.set(5); } }); } private static Text createText() { Text txt = new Text("XO"); txt.setTranslateX(50); txt.setFont(Font.font("Arial", 60)); txt.setFill(Color.LIGHTGREEN); txt.getStrokeDashArray().add(10.); txt.getStrokeDashArray().add(8.); return txt; } public static void main(String[] args) { Application.launch(ShortAppWithoutDependencies51.class, args); } }