/* For any bug or suggestion please contact: vaibhav.kumar@gmail.com */ /* Not yet checked the boundary conditions */ import javafx.ui.*; import javafx.ui.canvas.*; import javafx.ui.filter.*; import java.awt.Toolkit; import java.lang.System; Frame { title: "Hello World JavaFX" width: 300 height:300 undecorated: true centerOnScreen: true content: Canvas { content: ImageView { var x1 = bind 0 var y1 = bind 0 var pix = bind "http://www.delhimetrorail.com/commuters/images/routemap_big.jpg" image : Image { url: bind pix } transform: [translate(x1, y1), scale(1,1)] toolTipText: "Click to close the application" onMouseDragged : operation(e:CanvasMouseEvent) { x1 += e.localDragTranslation.x; y1 += e.localDragTranslation.y; } onMouseClicked : operation(e:CanvasMouseEvent) { System.exit(0); } } } visible: true }