javax.swing.JPopupMenu.requestFocusInWindow()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中javax.swing.JPopupMenu.requestFocusInWindow()方法的一些代码示例,展示了JPopupMenu.requestFocusInWindow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JPopupMenu.requestFocusInWindow()方法的具体详情如下:
包路径:javax.swing.JPopupMenu
类名称:JPopupMenu
方法名:requestFocusInWindow

JPopupMenu.requestFocusInWindow介绍

暂无

代码示例

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

@Override
      public void actionPerformed(final ActionEvent e) {
        final JPopupMenu pm = getPopupMenu();
        
        if (pm != null) {
//                    if (showPopup) {
            pm.show(DropDownMenuButton.this, 0, DropDownMenuButton.this.getHeight());
            pm.requestFocusInWindow();
//                    } else {
//                        showPopup = true;
//                    }
        }
      }
    };

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

/**
 * Display the specified popup menu at the location specified by a mouse
 * event with the specified source component.
 *
 * @param invoker
 *            the source component
 * @param e
 *            the mouse event causing this popup to be displayed
 * @param popup
 *            the popup menu to display
 */
public void displayPopUp(Component invoker, MouseEvent e, JPopupMenu popup) {
  if (popup != null) {
    log.debug("Showing pop up for {} at x,y = {},{}", invoker, e.getX(), e.getY());
    popup.pack();
    popup.show(invoker, e.getX(), e.getY());
    popup.setVisible(true);
    popup.requestFocusInWindow();
  }
}

代码示例来源:origin: org.cytoscape/vizmap-gui-impl

@Override
  public void actionPerformed(final ActionEvent e) {
    final LockedValueState state = vpSheetItem.getModel().getLockedValueState();
    final JButton btn = vpSheetItem.getBypassBtn();
    
    if (state == LockedValueState.ENABLED_NOT_SET) {
      // There is only one option to execute, so do it now, rather than showing the popup menu
      openLockedValueEditor(e, vpSheetItem);
    } else {
      bypassMenu.show(btn, 0, btn.getHeight());
      bypassMenu.requestFocusInWindow();
    }
  }
});

相关文章

JPopupMenu类方法