如何全屏显示多个面板的一个面板,以及面向多个面板的任何面板

时间:2015-04-27 14:41:14

标签: javafx javafx-8

我设计了一个嵌入了几个面板的分割窗格,如下所示:

enter image description here

我的问题是:如果我想要全屏并且面对其中一个面板,例如上面一个面板,我该怎么做?

我尝试了一些东西:
  1)将舞台设置为全屏
  2)使用另一个面板,例如嵌入上面板的newPane
  3)然后scene = new Scene(newPanel),但只是水平全屏。像这样:   enter image description here

你能看到,下半部分是空的,是否有人知道如何实现这样的功能 - 全屏和toFront指定的面板?

非常感谢您的任何建议!

1 个答案:

答案 0 :(得分:0)

尝试将graph的高度和宽度与场景的高度和宽度绑定。

graph.prefWidthProperty().bind(scene.widthProperty());
graph.prefHeightProperty().bind(scene.heightProperty());