selection of tree node

95 views
Skip to first unread message

Radoslav Dorcik

unread,
Sep 10, 2021, 6:34:50 PM9/10/21
to seesaw-clj

Hello,

I'm trying to find the way how to select and expand some node in JTree for given path. In Java I would do something it like:
tree.setSelectionPath(path);
tree.scrollPathToVisible(path);

How is it possible to do in seesaw tree [1] ?

Thank you,
Rado



ja...@brunchboy.com

unread,
Sep 15, 2021, 7:19:25 PM9/15/21
to seesaw-clj
The seesaw tree extends a normal JTree, so you can do this with clojure-java interop syntax; I do exactly this in my beat-link-trigger project. So your two examples would be:
(.setSelectionPath tree path)
(.scrollPathToVisible tree path)

Radoslav Dorcik

unread,
Nov 2, 2021, 2:13:29 PM11/2/21
to seesaw-clj
thank you very much for help, it solved my problem!

I'm very surprised how simple is to use Java API from Clojure.
Reply all
Reply to author
Forward
0 new messages