Button with popup showed below [closed]

不想你离开。 提交于 2019-12-02 11:19:32
jewelsea

After answering this, I realized it was a duplicate of JavaFX 2 custom popup pane, which has a bit more context info in some of the answers.

Use a MenuButton and in a menuItem attached to the MenuButton, set a graphic for the content you want to display in your popup.

final MenuItem wizPopup = new MenuItem();
wizPopup.setGraphic(wizBox);

final MenuButton popupButton = new MenuButton("frobozz");
popupButton.getItems().setAll(
  wizPopup            
);

Here is a complete, executable sample.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!