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

前端 未结 5 1105
野的像风
野的像风 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条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-11 06:38

    final Stage stage = new Stage(StageStyle.TRANSPARENT);
    Group rootGroup = new Group();
    Scene scene = new Scene(rootGroup, 339, 319, Color.TRANSPARENT);
    stage.setScene(scene);
    stage.centerOnScreen();
    stage.show();
    

提交回复
热议问题