Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我很感兴趣当我用鼠标右键单击标签标签时如何添加带有选项的下拉菜单?有没有例子?
您可以使用setContextMenu()Tab 来执行此操作。ContextMenu javadoc 页面包含有关创建菜单的信息 - 它与标准 JavaFX 菜单非常相似(只需 do等contextMenu.getItems().addAll(item1, item2);)。
setContextMenu()
contextMenu.getItems().addAll(item1, item2);