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

前端 未结 5 1096
野的像风
野的像风 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:27

    Already OK! Also invoke dialogStage.initOwner(parentStage) http://docs.oracle.com/javafx/2/api/javafx/stage/Stage.html#initOwner%28javafx.stage.Window%29

    0 讨论(0)
  • 2020-12-11 06:30

    It is not yet possible in javafx but javafx is swing compatible so you can use swing to make a swing equivalent to a transparent utility stage. See here for some examples. I hope that this helps.

    0 讨论(0)
  • 2020-12-11 06:34

    something thus?

    enter image description here

    has an effect on the background

    leads code

    dialog.initModality(Modality.WINDOW_MODAL);
    
    0 讨论(0)
  • 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);
    
    0 讨论(0)
  • 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();
    
    0 讨论(0)
提交回复
热议问题