package test; import javafx.application.Application; import javafx.event.EventHandler; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.scene.paint.Color; import javafx.scene.shape.Rectangle; import javafx.stage.Stage; public class SynthRep extends Application { @Override public void start(Stage stage) { stage.setTitle("Synthesized Reporter"); Group root = new Group(); Scene scene = new Scene(root, 500, 500); Rectangle rect = new Rectangle (50, 50, 400, 400); rect.setFill(Color.RED); root.getChildren().add(rect); rect.addEventHandler(MouseEvent.ANY, new EventHandler() { @Override public void handle(MouseEvent event) { System.out.println(event.getEventType() + ": " + event.isSynthesized()); } }); stage.setScene(scene); stage.show(); } public static void main(String[] args) { Application.launch(args); } }