A javaFX Stage could be both StageStyle.UTILITY and StageStyle.TRANSPARENT?

前端 未结 5 1103
野的像风
野的像风 2020-12-11 06:05

I mean that when using a stage with stageStyle.UTILITY, I don\'t want to show the \"solid white background \" but a transparent background.

I need a stage doesn\'t s

5条回答
  •  猫巷女王i
    2020-12-11 06:35

    Look here How can I remove my javafx program from the taskbar

    just add (to move it out of sight)

    primaryStage.setX(Double.MAX_VALUE);
    primaryStage.setY(Double.MAX_VALUE);
    

    and replace

    mainStage.initStyle(StageStyle.UNDECORATED);
    

    with

    mainStage.initStyle(StageStyle.TRANSPARENT);
    

提交回复
热议问题