public class Lighting
  Comment     Returned-by     Constructor-argument     Method-argument     Field-type     Type-bound     Links  

An effect that simulates a light source shining on the given content, which can be used to give flat objects a more realistic, three-dimensional appearance.

Example:


 Light.Distant light = new Light.Distant();
 light.setAzimuth(-135.0);

 Lighting lighting = new Lighting();
 lighting.setLight(light);
 lighting.setSurfaceScale(5.0);

 Text text = new Text();
 text.setText("JavaFX!");
 text.setFill(Color.STEELBLUE);
 text.setFont(Font.font(null, FontWeight.BOLD, 60));
 text.setX(10.0);
 text.setY(10.0);
 text.setTextOrigin(VPos.TOP);

 text.setEffect(lighting);
 

The code above produces the following:

The visual effect of Lighting on text

extends Effect

Since:  JavaFX 2.0