2

I know in java-fx to make the window transparent, you need to set the stage style as stage.initStyle(StageStyle.TRANSPARENT);. However this will also remove any stage decorations so this does not solve my problem.

The reason I need this is because my application will need to use stage.setAlwaysOnTop(); at certain points, but this feature is not well supported on the target system (centOS). The application also requires stage.setIconnified();, but this does not work if the stage is undecorated.

Any suggestions will be appreciated. Thanks

Sadiq A
  • 36
  • 3

1 Answers1

0

The short answer would be "no, you can't" ... because the minimize/maximize/close buttons are part of the decoration. No decoration - no buttons. It would be a contradiction in itself.

If you need the functionality of those buttons, you would have to create your own buttons as a part of your UI and emulate the behaviour of the decoration buttons. That's what many apps do that come with no default decoration.

Anyway, if you want to manipulate the window behaviour in this way (stay-on-top/iconify, etc.) you always need to take the underlying operating system into account. Any apps (not only Java apps) are only allowed to interfere with window management as far as the OS windowing system allows them to do so. For example, in various MS Windows versions, the OS behaviour changed several times at this point.

Robert Rohm
  • 331
  • 1
  • 7