Adam Bien's Weblog

Transparent Windows (Stage) With Java FX 2

To make the main Java FX window completely transparent, you only have to set the StageStyle.TRANSPARENT and the Scene#setFill(null):

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class TransparentStage extends Application {

    public void start(Stage stage) {
        Text text = new Text("Transparent!");
        text.setFont(new Font(40));
        VBox box = new VBox();
        final Scene scene = new Scene(box,300, 250);

    public static void main(String[] args) {

Checkout the TransparentStage sample (source code).

Classic Java EE 7 Workshops: Bootstrap, Effective and Architectures, July, 13th-15th
Online workshop: Java EE 7 Bootstrap


A book about rethinking Java EE Patterns


this post was very useful.
I didnt find anything in Oracles Doc about how to make a transparent stage..

thanks you!

Posted by Americo Hernandez on December 19, 2012 at 08:41 PM CET #

thanks :)

Posted by Sahil on June 07, 2014 at 12:11 AM CEST #

Thanks, very usefull.

Posted by faez jana on February 12, 2015 at 08:24 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments