I\'m trying to create a stage that doesn\'t appear on the Windows task bar and is undecorated (no borders and no close/minimize/maximize buttons). My end goal is to create a
Inspired by @Loki solution with a little upgrade (in my opinion)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
public class TransparentAndUtilityStageApp extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
primaryStage.initStyle(StageStyle.UTILITY);
primaryStage.setOpacity(0.);
primaryStage.show();
Stage stage = new Stage();
Label label = new Label("Rainmeter");
StackPane stackPane = new StackPane(label);
stackPane.setPrefSize(600, 400);
stackPane.setStyle("-fx-background-color: transparent;");
Scene scene = new Scene(stackPane);
scene.setFill(null);
stage.initOwner(primaryStage);
stage.initStyle(StageStyle.TRANSPARENT);
stage.setScene(scene);
stage.show();
}
}