Explore and drive a running JavaFX application from its Clojure REPL.
Calls run synchronously on the JavaFX thread; no Platform/runLater is needed. Input uses synthetic events and works without desktop focus. Application work scheduled by event handlers may finish later.
Start with tree/props to inspect, all/one to find, point to locate, and mouse-click!/key-tap!/key-chord! to interact. Separate press/release functions let you hold keys or buttons across calls.
Inspection accepts a Node, Scene, Window, or synthetic root (called el in signatures). The root contains all open windows. Queries search descendants; tree includes its starting element. Results contain live JavaFX objects. Input accepts a Window, Scene, or synthetic root, never a Node. Omitting the input target requires exactly one open window. Mouse input picks at scene coordinates; keyboard input follows that scene's current focus owner.
Example (p is the alias used throughout these docstrings): (require '[cljfx.plorer :as p]) (p/all javafx.stage.Window) (def window (p/one javafx.stage.Window)) ; assumes one open window (p/tree window :depth 3 :props [:id :text]) (def field (p/one window "#name")) ; replace with a field ID found above (p/mouse-click! window (p/point field 0.5 0.5) :primary) (p/key-tap! window :a) (p/props field :only [:text])
Explore and drive a running JavaFX application from its Clojure REPL. Calls run synchronously on the JavaFX thread; no Platform/runLater is needed. Input uses synthetic events and works without desktop focus. Application work scheduled by event handlers may finish later. Start with tree/props to inspect, all/one to find, point to locate, and mouse-click!/key-tap!/key-chord! to interact. Separate press/release functions let you hold keys or buttons across calls. Inspection accepts a Node, Scene, Window, or synthetic root (called el in signatures). The root contains all open windows. Queries search descendants; tree includes its starting element. Results contain live JavaFX objects. Input accepts a Window, Scene, or synthetic root, never a Node. Omitting the input target requires exactly one open window. Mouse input picks at scene coordinates; keyboard input follows that scene's current focus owner. Example (p is the alias used throughout these docstrings): (require '[cljfx.plorer :as p]) (p/all javafx.stage.Window) (def window (p/one javafx.stage.Window)) ; assumes one open window (p/tree window :depth 3 :props [:id :text]) (def field (p/one window "#name")) ; replace with a field ID found above (p/mouse-click! window (p/point field 0.5 0.5) :primary) (p/key-tap! window :a) (p/props field :only [:text])
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |