javax.swing.JMenu.addMouseListener()方法的使用及代码示例

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

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

JMenu.addMouseListener介绍

暂无

代码示例

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Returns the <code>JMenu</code> displaying the appropriate menu items for
 * manipulating the Frame.
 *
 * @return <code>JMenu</code> displaying the appropriate menu items for
 *         manipulating the Frame.
 */
@Override
protected JMenu createSystemMenu() {
  JMenu menu = super.createSystemMenu();
  menu.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      if (e.getClickCount() > 1) {
        closeAction.actionPerformed(new ActionEvent(e.getSource(),
            ActionEvent.ACTION_PERFORMED, null,
            EventQueue.getMostRecentEventTime(), e.getModifiers()));
      }
    }
  });
  return menu;
}

代码示例来源:origin: PortSwigger/backslash-powered-scanner

public void run()
{
  menuButton = new JMenu("Backslash");
  menuButton.addMouseListener(new MouseAdapter() {
    @Override
    public void mousePressed(MouseEvent mouseEvent) {
      SwingUtilities.invokeLater(new Runnable() {
        public void run(){
          Utilities.globalSettings.showSettings();
        }
      });
    }
  });
  JMenuBar burpMenuBar = getBurpFrame().getJMenuBar();
  burpMenuBar.add(menuButton);
}

代码示例来源:origin: com.github.insubstantial/substance

/**
 * Returns the <code>JMenu</code> displaying the appropriate menu items for
 * manipulating the Frame.
 *
 * @return <code>JMenu</code> displaying the appropriate menu items for
 *         manipulating the Frame.
 */
private JMenu createMenu() {
  JMenu menu = new JMenu("");
  menu.setOpaque(false);
  menu.setBackground(null);
  //if (this.getWindowDecorationStyle() == JRootPane.FRAME) {
    this.addMenuItems(menu);
  //}
  menu.addMouseListener(new MouseAdapter() {
    @Override
    public void mouseClicked(MouseEvent e) {
      if (e.getClickCount() > 1) {
        closeAction.actionPerformed(new ActionEvent(e.getSource(),
            ActionEvent.ACTION_PERFORMED, null,
            EventQueue.getMostRecentEventTime(), e.getModifiers()));
      }
    }
  });
  return menu;
}

代码示例来源:origin: stackoverflow.com

fileBtn.addMouseListener(
   new MouseAdapter() //This works

代码示例来源:origin: igniterealtime/Spark

mainStatusItem.addMouseListener(new MouseAdapter() {
  public void mouseClicked(MouseEvent mouseEvent) {
    statusAction.actionPerformed(null);

代码示例来源:origin: igniterealtime/Spark

statusMenu.add(status);
status.addMouseListener(new MouseAdapter() {
  @Override
  public void mouseClicked(MouseEvent mouseEvent) {

相关文章