JavaFX Effects - Glow

Just like the Bloom Effect, the Glow Effect also makes the given input image to glow. This effect makes the pixels of the input much brighter.

The class named Glow of the package javafx.scene.effect represents the glow effect. This class contains two properties namely −

  • input − This property is of the type Effect and it represents an input to the glow effect.

  • level − This property is of the type double; it represents intensity of the glow. The range of the level value is 0.0 to 1.0.


The following program is an example demonstrating the Glow Effect of JavaFX. In here, we are embedding the following image (Tutorialspoint Logo) in JavaFX scene using Image and ImageView classes. This will be done at the position 100, 70 and with fit height and fit width 200 and 400 respectively.

Glow Effect

To this image, we are applying the Glow Effect with the level value 0.9. Save this code in a file with the name

import javafx.application.Application; 
import javafx.scene.Group; 
import javafx.scene.Scene; 
import javafx.scene.effect.Glow; 
import javafx.scene.image.Image; 
import javafx.scene.image.ImageView; 
import javafx.stage.Stage; 
public class GlowEffectExample extends Application { 
   public void start(Stage stage) {               
      //Creating an image 
      Image image = new Image("");
      //Setting the image view 
      ImageView imageView = new ImageView(image); 
      //setting the fit width of the image view 
      //Setting the preserve ratio of the image view 
      //Instantiating the Glow class 
      Glow glow = new Glow(); 
      //setting level of the glow effect 
      //Applying bloom effect to text 
      //Creating a Group object  
      Group root = new Group(imageView);   
      //Creating a scene object 
      Scene scene = new Scene(root, 600, 300);  
      //Setting title to the Stage 
      stage.setTitle("Sample Application"); 
      //Adding scene to the stage 
      //Displaying the contents of the stage;         
   public static void main(String args[]){ 

Compile and execute the saved java file from the command prompt using the following commands.

java GlowEffectExample

On executing, the above program generates a JavaFX window as shown below.

Glow Effect Example