JavaFX中的隐形舞台/场景 [英] Invisible Stage/Scene in JavaFX

查看:273
本文介绍了JavaFX中的隐形舞台/场景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找隐藏JavaFX舞台或场景的方法。现在我知道 .hide(),但这不起作用。我需要的东西仍然保持窗口,但只是让它完全透明。一个很好的比喻是CSS中的 display:none visibility:hidden 。第一个完全完全从屏幕中删除标签/节点,而第二个只是使其不可见。我喜欢JavaFX中的 visibility ,而不是display(这是hide和show方法)。它也可能有助于我的舞台装饰设置为TRANSPARENT。这应该会让事情变得更容易。

I'm looking for a way to hide a JavaFX Stage or Scene. Now I know about .hide(), but that won't work. I need something that still keeps the window, but just makes it completely transparent. A good analogy is display: none and visibility: hidden in CSS. Whereas the first completely and totally removes a tag/node from the screen, the second just makes it invisible. I'd like something like visibility in JavaFX, not display (which is the hide and show methods). It also might help that my stage decoration is set to TRANSPARENT. That should make things a little easier.

我已经尝试将舞台移出屏幕,但这会让整个程序做一些意想不到的事情。它会抛出很多错误,显然不应该这样。

I've already tried moving the stage off the screen, but that makes the whole program do some unexpected things. It throws a lot of errors that it clearly shouldn't.

还有一件事:如果有可能,我希望能够移动/与窗口交互,即使你看不到它。如果这太难了,那没关系。它不是必需的。

One more thing: If it's possible, I'd like to be able to move/interact with the window, even though you can't see it. If this is too hard, that's okay. Its not really necessary.

推荐答案

如何在舞台上使用toBack()。

How about using toBack() on your Stage.

这篇关于JavaFX中的隐形舞台/场景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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