[英]JavaFX scene builder: having a root node different from AnchorPane
JavaFX scene builder starts editing an AnchorPane. JavaFX场景构建器开始编辑AnchorPane。 JavaFX doesn't require the root Node to be an AnchorPane, there are cases in which another class is preferrable.
JavaFX不要求根节点是AnchorPane,在某些情况下,另一个类是可取的。
Is there a way to change the rooot container in JavaFX Scene Builder? 有没有办法在JavaFX Scene Builder中更改rooot容器?
Choose menu Item: 选择菜单项:
File |
档案| New with Root Container
Root容器的新功能
With b44 of the SceneBuilder, options available are Anchor Pane, Border Pane or Stack Pane 使用SceneBuilder的b44,可用的选项是Anchor Pane,Border Pane或Stack Pane
You can also directly edit the fxml in a text editor to set the root pane to for instance a Flow Pane, then load the edited fxml into the SceneBuilder and the SceneBuilder will recognize it. 您还可以在文本编辑器中直接编辑fxml,将根窗格设置为例如Flow Pane,然后将编辑好的fxml加载到SceneBuilder中,SceneBuilder将识别它。
To set another pane as root rather than the three altneratives available under New with root container > ...
(without editing the fxml directly), do the following: 要将另一个窗格设置为root而不是
New with root container > ...
下可用的三个altnerative(不直接编辑fxml),请执行以下操作:
Edit > Trim document to selection
. Edit > Trim document to selection
。 Voila! 瞧!
Tip: Use the menu selections: Arrange > Wrap in > ...
and Arrange > Unwrap
to insert or remove containers around child items. 提示:使用菜单选项:
Arrange > Wrap in > ...
和Arrange > Unwrap
以插入或删除子项目周围的容器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.