Skip to main content

JavaFX fxml drawing

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
mezlogo
Offline
Joined: 2013-09-01

Hi all!
I don't know, can i ask here, so if not - SORRY.

Question:
How draw polygoonon a parent root, or pane in root.

public void start(Stage primaryStage) throws IOException {
Parent root = FXMLLoader.load(getClass().getResource("sample.fxml"));
Scene scene = new Scene(root);
forDraw = new Pane();
myPolygon = new Polygon();
myPolygon.getPoints().addAll(new Double[]{ 0.0, 0.0, 20.0, 10.0, 10.0, 20.0 });
myPolygon.setStroke(Color.BLACK);
primaryStage.setScene(scene);
primaryStage.show();
}



Not work