如何使放置在BorderPane中心的ScrollPane正常工作? [英] How do you get a ScrollPane that is placed in the center of a BorderPane to work?

查看:127
本文介绍了如何使放置在BorderPane中心的ScrollPane正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序,其中有一个由BorderPane制作的rootLayout.当我在该rootLayout中按下按钮时,我使用.setCenter()将新的fxml视图放置到borderPane的中心.我放置在borderPane中的视图由AnchorPane组成,该对象具有一个scrollPane作为它的子元素,当我自己运行此视图时,滚动工作.但是,将视图放入borderPane后,它将停止工作.当我向下或向上滚动时,scrollPane中的区域完全不移动.我猜想这与borderPane中给定的大小有关,但是具有scrollPane的要点是,这样我就可以在1/3的空间中显示所有信息.

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.

关于如何在javafx,fxml或scenebuilder中实现此功能的任何提示或想法?

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

推荐答案

还不能发表评论……如果我错了,请纠正我,但是您不是必须将AnchorPane用作ScrollPane的子级吗?我始终将TextAres作为ScrollPanes的子代!

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!

这篇关于如何使放置在BorderPane中心的ScrollPane正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆