JavaFX BoxBlur effect

Description

JavaFX BoxBlur effect

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.BoxBlur;
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  www . j  a  va2 s . co  m*/
  }

  @Override
  public void start(Stage stage) {
    Text t1 = new Text("demo2s.com");
    t1.setFont(Font.font(24));
    t1.setEffect(new BoxBlur());

    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