Explore and drive a running JavaFX application from its Clojure REPL. Useful for coding agents with REPL access: inspect the live scene graph, find controls, and interact through synthetic keyboard and mouse events without desktop focus.
Using deps.edn:
io.github.cljfx/plorer {:mvn/version "1.25"}
Using Leiningen:
[io.github.cljfx/plorer "1.25"]
Run this in your application's REPL. The example assumes one open window and a text field whose ID is name; adapt the selector to your application.
(require '[cljfx.plorer :as p])
;; Find a window and inspect its contents.
(p/all javafx.stage.Window)
(def window (p/one javafx.stage.Window))
(p/tree window :depth 3 :props [:id :text])
;; Find a field and click its center.
(def field (p/one window "#name"))
(p/mouse-click! window (p/point field 0.5 0.5) :primary)
;; Type "hi!" using the virtual US keyboard.
(doseq [key [:h :i]]
(p/key-tap! window key))
(p/key-chord! window [:shift :digit1])
;; Inspect the result.
(p/props field :only [:text])
Platform/runLater is needed. Mouse input requires a showing window, but desktop focus is not required.[x y] in scene logical pixels, measured from the content area's top-left. point converts relative positions within a node's layout bounds to those coordinates: 0 0 is top-left, 0.5 0.5 is center, and 1 1 is bottom-right.Can you improve this documentation? These fine people already did:
Vlad Protsenko & vlaaadEdit on GitHub
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 |