Public API for robot classes in JDK 9

Benjamin Gudehus hastebrot at
Mon Dec 14 10:41:04 UTC 2015

The missing public API for robots (`` and
`com.sun.javafx.robot.FXRobot`) is causing me sleepless nights. Here ( is a small prototype for a possible API to
ignite some discussion. In case the proposed delay of JDK 9 (
takes place.

About the architecture:

In the prototype I decided to not touch classes in `` and
instead provide "wrapper" classes. This is a pattern which is also used for
other classes in the JavaFX codebase, to provide a public API for
functionality from e.g. `com.sun.prism` and `com.sun.javafx`. Additionally
`` has dependencies to other private classes in its
package and to native bindings to different operating systems and Monocle.

About the implementation:

- `javafx.application.ApplicationMixin::createGlassRobot()` returns a new
`javafx.application.util.GlassRobot`. The methods of `ApplicationMixin`
will of course find their places in `javafx.application.Application`

- The `GlassRobot` is in the `javafx.util` package. It could also go into a
new `javafx.robot` package instead. `GlassRobot` uses classes from the
JavaFX API like `KeyCode`, `Point2D` and `MouseButton` instead of primitive
types which are used by ``.

(I've created a new mail thread in order to permalink to it and allow
others without JIRA writing access to participate in the discussion. A JIRA
ticket should be definately created via -- if none already
exist; I'll check this. I also know the code needs to be patch files into
order to be merged into HG.)


More information about the openjfx-dev mailing list