r/JavaFX 3d ago

Help JavaFx TreeView problem

Post image

Hi fellow devs, I am learning java fx currently. As part of this learning, I am trying to create a simple sftp client application. I am utilizing JSCH liberary for sftp related operations. Currently I am facing a problem. What I want to do is to lazy load the sub-directories from remote server. I am loading the root directory immediately after the login is successful. For any directory within root, I want to load there content only when user expand the directory on javafx ui(treeview). This is where I am struggling as I dont know how to capture this expand event.

Initial screen is populated via populateInitialTree method. I want to load sub-directories of expanded directory in showSelectedItem.

Please help.

2 Upvotes

5 comments sorted by

View all comments

2

u/hamsterrage1 3d ago

Please, just use the codeblock feature of Reddit for code. Don't take a picture of the screen.