/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package popuptest; 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.Tooltip; import javafx.scene.layout.StackPane; import javafx.stage.Stage; /** * * @author Imperia AG */ public class PopupTest extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello Pop up!"); Button btn = new Button(); btn.setText("Hold mouse over me, please!"); btn.setTooltip(new Tooltip("Hello!")); btn.setOnAction(new EventHandler() { @Override public void handle(ActionEvent event) { System.out.println("Hello World!"); } }); StackPane root = new StackPane(); root.getChildren().add(btn); primaryStage.setScene(new Scene(root, 300, 250)); primaryStage.show(); primaryStage.requestFocus(); } }