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.control.MenuButton; import javafx.scene.control.MenuItem; import javafx.scene.control.Tooltip; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import javafx.stage.Modality; import javafx.stage.Stage; public class TooltipTest extends Application { public static void main(String[] args) { Application.launch(args); } @Override public void start(final Stage stage) { HBox root = new HBox(); final Scene scene = new Scene(root); stage.setWidth(300); stage.setHeight(200); stage.setScene(scene); final VBox box = new VBox(40); final MenuButton test = new MenuButton(); test.setText("Test"); test.getItems().addAll(new MenuItem("Menu item 1..."), new MenuItem("Menu item 2...")); test.setTooltip(new Tooltip("Hello! Am I in your way??")); test.setOnAction(new EventHandler() { public void handle(ActionEvent e) { test.show(); } }); final Button reload = new Button("Open stage"); reload.setOnAction(new EventHandler() { public void handle(ActionEvent e) { Stage stage = new Stage(); stage.initModality(Modality.APPLICATION_MODAL); stage.setHeight(100); stage.setWidth(200); stage.setTitle("Popup"); stage.setResizable(false); VBox vbox2 = new VBox(); vbox2.getChildren().add(new Label("Just a label")); Scene scene2 = new Scene(vbox2); stage.setScene(scene2); stage.show(); } }); box.getChildren().addAll(test, reload); root.getChildren().addAll(box); stage.show(); } }