You can't create a JavaFX stage window that does not appear in the taskbar that is also undecorated and transparent. These types of windows are important to make fade/slide in alerts on the desktop like an email notifiier, an IM notifier, a growl/snarl effect, etc.
You can create an Undecorated window, but it still shows in the taskbar.
stage.initStyle(StageStyle.UNDECORATED);
stage.show();
You can create a Transparent stage window, but it still shows in the taskbar.
stage.initStyle(StageStyle.TRANSPARENT);
stage.show();
You can create a Utility window that does NOT show in the taskbar, but you can't make it undecorated.
stage.initStyle(StageStyle.UTILITY);
stage.show();
If you could do a bit mask of the 3 properties of StageStyle.UTILITY, StageStyle.UNDECORATED, and StageStyle.TRANSPARENT the effect could be achieved.
If you create a PopupWindow the desired effect can be closer to achieved, however you need a parent window and that window always shows in the taskbar. You can do a hack where you create a UTILITY window so that it doesn't show up in the taskbar and then you can set the UTILITY window to be off-screen with something like stage.setX(-1000). That means you're creating a fake window just to get it to be a parent of the PopupWindow. This is a dangerous hack because that UTILITY window could get placed back on the main screen if the computer screen resizes like from a remote desktop session connect and the OS decides to place all windows back on the visible bounds. Tests have shown this doesn't happen, but it feels like it could in certain cases.
The desired effect could also be achieved by using a JFXPanel inside a JDialog window. That means that you are forced to use Swing first and then the JFXPanel on top of Swing. It would be much preferred to use pure JFX.
You can create an Undecorated window, but it still shows in the taskbar.
stage.initStyle(StageStyle.UNDECORATED);
stage.show();
You can create a Transparent stage window, but it still shows in the taskbar.
stage.initStyle(StageStyle.TRANSPARENT);
stage.show();
You can create a Utility window that does NOT show in the taskbar, but you can't make it undecorated.
stage.initStyle(StageStyle.UTILITY);
stage.show();
If you could do a bit mask of the 3 properties of StageStyle.UTILITY, StageStyle.UNDECORATED, and StageStyle.TRANSPARENT the effect could be achieved.
If you create a PopupWindow the desired effect can be closer to achieved, however you need a parent window and that window always shows in the taskbar. You can do a hack where you create a UTILITY window so that it doesn't show up in the taskbar and then you can set the UTILITY window to be off-screen with something like stage.setX(-1000). That means you're creating a fake window just to get it to be a parent of the PopupWindow. This is a dangerous hack because that UTILITY window could get placed back on the main screen if the computer screen resizes like from a remote desktop session connect and the OS decides to place all windows back on the visible bounds. Tests have shown this doesn't happen, but it feels like it could in certain cases.
The desired effect could also be achieved by using a JFXPanel inside a JDialog window. That means that you are forced to use Swing first and then the JFXPanel on top of Swing. It would be much preferred to use pure JFX.
- duplicates
-
JDK-8177296 Ability to create undecorated taskbar-less windows
-
- Closed
-