Hello everyone. I can do a little bit with JavaFX, but I am a newbie, and this is stumping me.
I want to overlay a menu with options like save, load, exit, etc. over a JavaFX Scene. I am not sure what this type of menu is commonly called, or if it has a specific name.
Here is a visual example of what I want to do that I made by combining screen-shots of Scenes with GIMP:
I haven't been able to find anything in JavaFX that would allow me to just overlay a menu on top of other visual elements. It's like everything needs to be on the same layer.
I am not asking you to write my code for me (though I won't object if you want to), but I could use some advice about how to do this. Is there some JavaFX class type that would make what I want to do fairly easy?
There seems to be three ways to do this. One is Node#toBack and Node#toFront and another is Node#viewOrder if you have JavaFX 9 or above. The last way is to manually control the child order in the scene graph. That is, the Nodes of a Scene are painted from first to last, with the last being on top. You can use Collections.swap(...) to change the elements in a List like the children of a Pane. See this answer for more details.
All things are lawful, but not all things are profitable.
posted 1 month ago
Thank you! I did the toFront() and toBack() thing, and it worked very well.