当前位置: 首页>>代码示例>>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;未经允许,请勿转载。