Reputation: 846
Is there any way to create a custom PopUp in JavaFX? I can't use tooltip, since I would like it to appear on double click, also I would like a different style than the standard tooltip.
My demands for the popup are: 1. If the user double click, show the popup 2. if the user clicks outside the popup, hide it
Upvotes: 0
Views: 257
Reputation: 6537
Use Popup.
Popup popup = new Popup();
// add content (you can add as many nodes as you want)
popup.getContent().add(new Label("Hello Popup!"));
// show (move this to the double-click listener)
popup.show(primaryStage);
// hide (move this to the click listener)
popup.hide();
Upvotes: 0