Invisible Stage/Scene in JavaFX

拜拜、爱过 提交于 2019-12-13 15:14:06

问题


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.


回答1:


How about using toBack() on your Stage.



来源:https://stackoverflow.com/questions/23097086/invisible-stage-scene-in-javafx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!