Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

javafx

stage

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.

like image 596
Keon Wang Avatar asked Mar 19 '13 14:03

Keon Wang


People also ask

What is JavaFX stage stage?

The JavaFX Stage class is the top level JavaFX container. The primary Stage is constructed by the platform. Additional Stage objects may be constructed by the application. Stage objects must be constructed and modified on the JavaFX Application Thread.

What is stage and scene in JavaFX?

The class Scene of the package javafx. scene represents the scene object. At an instance, the scene object is added to only one stage. You can create a scene by instantiating the Scene Class. You can opt for the size of the scene by passing its dimensions (height and width) along with the root node to its constructor.


3 Answers

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

like image 184
Keon Wang Avatar answered Oct 30 '22 01:10

Keon Wang


something thus?

enter image description here

has an effect on the background

leads code

dialog.initModality(Modality.WINDOW_MODAL);
like image 37
Perco Avatar answered Oct 30 '22 01:10

Perco


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.

like image 35
sazzy4o Avatar answered Oct 30 '22 01:10

sazzy4o