package class4_2_JavaFXAndAnonymousInnerClasses; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.effect.BoxBlur; import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.stage.Stage; public class Main2_AnonymousInnerClass extends Application { private Label label; @Override public void start(Stage primaryStage) throws Exception{ Pane root = new StackPane(); label = new Label("This is a lot of text that will show up on the screen!"); Button clickMe = new Button("Click Me!"); clickMe.setOnAction(new EventHandler () { public void handle(ActionEvent e) { label.setEffect(new BoxBlur()); } } ); root.getChildren().addAll(label, clickMe); primaryStage.setTitle("Hello World"); primaryStage.setScene(new Scene(root, 300, 50)); primaryStage.show(); } public static void main(String[] args) { launch(args); } }