當前位置: 首頁>>代碼示例>>Java>>正文


Java JMenu.remove方法代碼示例

本文整理匯總了Java中javax.swing.JMenu.remove方法的典型用法代碼示例。如果您正苦於以下問題:Java JMenu.remove方法的具體用法?Java JMenu.remove怎麽用?Java JMenu.remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JMenu的用法示例。


在下文中一共展示了JMenu.remove方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addMenuItems

import javax.swing.JMenu; //導入方法依賴的package包/類
/** 
 * Adds to a given menu all the items of another menu.
 * The submenu may be {@code null}, in which case nothing is added 
 * @param submenu the menu to be added to the popup menu;
 * will be destroyed as a consequence of this method call
 */
final public void addMenuItems(JMenu submenu) {
    if (submenu != null && submenu.getItemCount() > 0) {
        // as we move items from the submenu to the main menu
        // the submenu gets modified
        while (submenu.getItemCount() > 0) {
            JMenuItem item = submenu.getItem(0);
            if (item == null) {
                submenu.remove(0);
                addSeparator();
            } else {
                add(item);
            }
        }
    }
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:22,代碼來源:MyJMenu.java

示例2: detachWorkspace

import javax.swing.JMenu; //導入方法依賴的package包/類
/** Frees all listeners etc from given workspace. */
void detachWorkspace(
    Workspace workspace, Hashtable workspace2Menu, Hashtable menu2Workspace, Hashtable workspace2Listener,
    JMenu menu
) {
    JRadioButtonMenuItem menuItem = (JRadioButtonMenuItem) workspace2Menu.get(workspace);
    workspace2Menu.remove(workspace);
    menu2Workspace.remove(workspace2Listener.get(workspace));
    workspace2Listener.remove(workspace);
    menu.remove(menuItem);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:12,代碼來源:WorkspaceSwitchAction.java

示例3: addExternalAction

import javax.swing.JMenu; //導入方法依賴的package包/類
/**
 * Adds an action to the external actions menu of the simulator. This
 * provides a primitive plugin mechanism.
 */
public void addExternalAction(Action action) {
    JMenu externalMenu = getExternalActionsMenu();
    // remove the dummy action if it is still there
    if (externalMenu.getItem(0)
        .getAction() == this.dummyExternalAction) {
        externalMenu.remove(0);
    }
    getExternalActionsMenu().add(action);
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:14,代碼來源:Simulator.java

示例4: fixMenu

import javax.swing.JMenu; //導入方法依賴的package包/類
private static void fixMenu(JMenu menu) {
    for (int i = menu.getItemCount(); i > 3; i--) {
        menu.remove(i - 1);
    }

    for (MysterFrame frame : windows) {
        new MysterMenuItemFactory(frame.getTitle(), new OtherWindowHandler(frame))
                .makeMenuItem(frame, menu);
    }
}
 
開發者ID:addertheblack,項目名稱:myster,代碼行數:11,代碼來源:WindowManager.java


注:本文中的javax.swing.JMenu.remove方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。