See e810 创建弹出菜单 for an example on how to display a popup menu.
final JPopupMenu popupMenu = new JPopupMenu(); // Create a submenu with items JMenu submenu = new JMenu("SubMenu1"); submenu.add(action1); submenu.add(action2); // Add submenu to popup menu popupMenu.add(submenu);
Related Examples |