Reputation: 365
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 shown on the windows' task bar below(stageStyle.UTILITY can satisfy), and I need a transparent background(StageStyle.TRANSPARENT can satisfy)so that I can define the close button style of my stage.
But it seems strange that stageStyle.UTILITY or StageStyle.TRANSPARENT only fit one of my request.
Thank you.
Upvotes: 7
Views: 6051
Reputation: 809
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);
Upvotes: 0
Reputation: 3343
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.
Upvotes: 1
Reputation: 160
something thus?
has an effect on the background
leads code
dialog.initModality(Modality.WINDOW_MODAL);
Upvotes: 1
Reputation: 365
Already OK! Also invoke dialogStage.initOwner(parentStage) http://docs.oracle.com/javafx/2/api/javafx/stage/Stage.html#initOwner%28javafx.stage.Window%29
Upvotes: 4
Reputation: 160
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();
Upvotes: 0