How do you get a ScrollPane that is placed in the center of a BorderPane to work?

馋奶兔 提交于 2019-12-11 12:04:51

问题


I have a program where i have a rootLayout made from a BorderPane. When i press a button in this rootLayout i place a new fxml view into the center of the the borderPane using .setCenter(). The view i am placing into the borderPane consists of an AnchorPane that has a scrollPane as it's child element and when i run this view by itself the scrolling works. However after placing the view into the borderPane it stops working. The area in the scrollPane doesnt move at all when i scroll down or up. I am guessing this has to do with the size that is given in the borderPane but the whole point of having the scrollPane is so that i can show all of the information in 1/3 of the space.

Any tips or Ideas on how to make this work in either javafx, fxml or scenebuilder?


回答1:


Can't make comments yet ... correct me if I'm wrong but don't you have to use the AnchorPane as the child of the ScrollPane? I always have my TextAres as child of the ScrollPanes!



来源:https://stackoverflow.com/questions/28841212/how-do-you-get-a-scrollpane-that-is-placed-in-the-center-of-a-borderpane-to-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!