Can javaFX stage be either StageStyle.UTILITY or StageStyle.TRANSPARENT?

I mean, when using a scene with stageStyle.UTILITY, I don’t want to show a “solid white background”, but a transparent background.

I need a scene that is not shown on the Windows taskbar below (stageStyle.UTILITY can satisfy), and I need a transparent background (StageStyle.TRANSPARENT can satisfy) so that I can determine the style of the close button for my stage.

But it seems strange that stageStyle.UTILITY or StageStyle.TRANSPARENT matches only one of my queries.

Thanks.

+4
javafx stage
source share
4 answers
+3
source share

something this way?

enter image description here

affects the background

displays code

dialog.initModality(Modality.WINDOW_MODAL); 
+1
source share

This is not possible in javafx yet, but javafx is compatible with swing, so you can use swing to make the swing equivalent to the transparent step of the utility. See here for some examples. Hope this helps.

+1
source share
 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
source share

All Articles