/* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. */ package helloworld; import javafx.application.Application; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; /** * @author jcambon */ public class HelloCSSJC extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { Application.launch(args); } @Override public void start(Stage stage) { stage.setTitle("Hello CSS"); Scene scene = new Scene(new Group(), 600, 450); scene.setFill(Color.LIGHTGREEN); Rectangle rect = new Rectangle(); rect.getStyleClass().add("rect"); rect.setX(25); rect.setY(100); rect.setWidth(100); rect.setHeight(50); rect.setStyle("-fx-stroke: yellow;"); rect.setStyle("-fx-stroke-dash-array: 1 3;"); ((Group)scene.getRoot()).getChildren().addAll(rect); stage.setScene(scene); stage.show(); } }