• Post Reply Bookmark Topic Watch Topic
  • New Topic

Stages and Focus in javafx  RSS feed

colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a stage that I want to keep at the back of the desktop behind any other windows.

If I use stage.toBack(), then the stage flickers as it goes to the back of screen once pressed on.
So my partial solution was to use a transparent stage in front of this.
The transparent stage, I call it a "Visor", could accept mouse input and apply it to the main stage behind,
and it would prevent the main stage from being pressed on, so it will never be focused on and come to the front of screen.

This works, but there's an issue.
Suppose the main stage is at the back, and the visor is in front, and suppose firefox browser is partially covering the visor.
Then when the visor is pressed on, it will be focused and so come to the front of the screen, in front of firefox.
So after releasing mouse, and pressing on part of the firefox browser, it will not accept mouse input since its actually the visor that is being pressed on.
So basically I can't control the Z-order of this stage, except for toFront() or toBack(), but that doesn't stop the sandwhiching effect of a browser going inbetween the 2 stages.

I hope thats clear, please let me know if theres any suggestions to fix it, as its driving me up the wall.

Thanks very much.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!