JavaFX中的自定义弹出窗口

时间:2014-11-19 10:40:19

标签: javafx treeview

有没有办法在JavaFX中创建自定义PopUp?我无法使用工具提示,因为我希望它在双击时出现,我也想要与标准工具提示不同的风格。

我对弹出窗口的要求是: 1.如果用户双击,则显示弹出窗口 2.如果用户在弹出窗口外单击,则将其隐藏

2 个答案:

答案 0 :(得分:1)

See this guide on all the different types of popups.

答案 1 :(得分:0)

使用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();
相关问题