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


Java JPopupMenu.setFocusable方法代碼示例

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


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

示例1: maybeShowPopup

import javax.swing.JPopupMenu; //導入方法依賴的package包/類
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		JPopupMenu popupMenu = new JPopupMenu();
		popupMenu.setFocusable(false);

		popupMenu.add(jMenuItemUndo);
		popupMenu.add(jMenuItemRedo);
		popupMenu.addSeparator();
		popupMenu.add(jMenuItemCut);
		popupMenu.add(jMenuItemCopy);
		popupMenu.add(jMenuItemPaste);
		popupMenu.addSeparator();
		if (jMenuItemInsCell.getAction().isEnabled()) {
			popupMenu.add(jMenuItemInsCell);
			jMenuItemInsCell.setEnabled(true);
			popupMenu.add(jMenuItemInsRow);
			jMenuItemInsRow.setEnabled(true);
			popupMenu.addSeparator();
		}
		popupMenu.add(jMenuItemProp);
		popupMenu.show(e.getComponent(), e.getX(), e.getY());

	}
}
 
開發者ID:ser316asu,項目名稱:Reinickendorf_SER316,代碼行數:25,代碼來源:HTMLEditor.java

示例2: maybeShowPopup

import javax.swing.JPopupMenu; //導入方法依賴的package包/類
private void maybeShowPopup(MouseEvent e) {
    if (e.isPopupTrigger()) {
        JPopupMenu popupMenu = new JPopupMenu();
        popupMenu.setFocusable(false);

        popupMenu.add(jMenuItemUndo);
        popupMenu.add(jMenuItemRedo);
        popupMenu.addSeparator();
        popupMenu.add(jMenuItemCut);
        popupMenu.add(jMenuItemCopy);
        popupMenu.add(jMenuItemPaste);
        popupMenu.addSeparator();
        if (jMenuItemInsCell.getAction().isEnabled()) {
            popupMenu.add(jMenuItemInsCell);
            jMenuItemInsCell.setEnabled(true);
            popupMenu.add(jMenuItemInsRow);
            jMenuItemInsRow.setEnabled(true);
            popupMenu.addSeparator();
        }
        popupMenu.add(jMenuItemProp);
        popupMenu.show(e.getComponent(), e.getX(), e.getY());

    }
}
 
開發者ID:ser316asu,項目名稱:SER316-Dresden,代碼行數:25,代碼來源:HTMLEditor.java

示例3: createPopupMenu

import javax.swing.JPopupMenu; //導入方法依賴的package包/類
/**
 * Creates a popup menu for the resource tree.
 * @param node tree node that the mouse is over
 */
JPopupMenu createPopupMenu(TreeNode node) {
    JPopupMenu res = new JPopupMenu();
    res.setFocusable(false);
    res.add(getActions().getNewAction(getResourceKind()));
    if (node instanceof ResourceTreeNode) {
        res.add(getActions().getEditAction(getResourceKind()));
        res.addSeparator();
        res.add(getActions().getCopyAction(getResourceKind()));
        res.add(getActions().getDeleteAction(getResourceKind()));
        res.add(getActions().getRenameAction(getResourceKind()));
        if (getResourceKind().isEnableable()) {
            res.addSeparator();
            res.add(getActions().getEnableAction(getResourceKind()));
        }
    }
    return res;
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:22,代碼來源:AbstractResourceTree.java

示例4: maybeShowPopup

import javax.swing.JPopupMenu; //導入方法依賴的package包/類
private void maybeShowPopup(MouseEvent e) {
	if (e.isPopupTrigger()) {
		JPopupMenu popupMenu = new JPopupMenu();
		popupMenu.setFocusable(false);
              
		popupMenu.add(jMenuItemUndo);
		popupMenu.add(jMenuItemRedo);
		popupMenu.addSeparator();
		popupMenu.add(jMenuItemCut);
		popupMenu.add(jMenuItemCopy);
		popupMenu.add(jMenuItemPaste);
		popupMenu.addSeparator();
		if (jMenuItemInsCell.getAction().isEnabled()) {
			popupMenu.add(jMenuItemInsCell);
			jMenuItemInsCell.setEnabled(true);
			popupMenu.add(jMenuItemInsRow);
			jMenuItemInsRow.setEnabled(true);
			popupMenu.addSeparator();
		}
		popupMenu.add(jMenuItemProp);
		//Add ScreenCap to Menu
		popupMenu.addSeparator();
		popupMenu.add(jMenuItemScreenCap);
		popupMenu.show(e.getComponent(), e.getX(), e.getY());
             
	}
}
 
開發者ID:ser316asu,項目名稱:Dahlem_SER316,代碼行數:28,代碼來源:HTMLEditor.java


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