为什么我不能设置AnchorPane的可调整大小属性? [英] Why can't I set AnchorPane's resizable attribute?

查看:433
本文介绍了为什么我不能设置AnchorPane的可调整大小属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JavaFX Scene Builder 1.1创建了一个FXML文件。默认情况下会创建一个AnchorPane。为什么我不能修改resizable属性?



解决方案

为什么你不能编辑边界



结帐和 Amy Fowler关于JavaFX布局的演示


I created a FXML file using JavaFX Scene Builder 1.1. An AnchorPane is created by default. Why can't I modify the resizable attribute?

解决方案

Why you can't edit bounds

Checkout the javadoc on layoutBounds and boundsInLocal. You will notice that both are ReadOnlyObjectProperties, which is why you can't directly modify them in SceneBuilder.

How to resize a node in SceneBuilder

You can indirectly effect the bounds properties and directly set the resizable properties of the node by altering the min, pref and max height and width.

You can also set the pref size by selecting the pane to be resized and dragging the resizing anchors the surround the selected pane.

Further Information

You might want to read the Oracle tutorial on Tips for Sizing Nodes and Amy Fowler's presentation on JavaFX layout.

这篇关于为什么我不能设置AnchorPane的可调整大小属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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