问题
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