JavaFX Bloom effect

Description

JavaFX Bloom effect


import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.Bloom;
import javafx.scene.layout.Pane;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;

public class Main extends Application {
  public static void main(String[] args) {
    Application.launch(args);/*from w  w  w  .  j  a v a2s  .co  m*/
  }

  @Override
  public void start(Stage stage) {
    Text t1 = new Text("Drop Shadow!");
    t1.setFont(Font.font(24));
    t1.setEffect(new Bloom(0.10));

    Pane root = new Pane();
    root.getChildren().add(t1);
    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Drawing on a Canvas");
    stage.show();
  }
}



PreviousNext

Related