java.awt.Button.getActionListeners()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(96)

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

Button.getActionListeners介绍

暂无

代码示例

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

Button b = ...;
b.addActionListener(new ActionListener() {
  ....
}); 

ActionListener[] listeners = b.getActionListeners();
for (ActionListener listener : listeners) {
  System.out.println(listener.getClass());  // Prints the reference to the class
}

代码示例来源:origin: net.java.openjdk.cacio/cacio-shared

/**
 * Receives notification when an action was performend on the button.
 * 
 * @param event
 *            the action event
 */
@Override
public void actionPerformed(ActionEvent event) {
  Button b = getAWTComponent();
  ActionListener[] l = b.getActionListeners();
  ActionEvent ev = new ActionEvent(b, ActionEvent.ACTION_PERFORMED, b
      .getActionCommand());
  // This sends both the new and old style events correctly.
  handlePeerEvent(ev);
}

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

StagedActionEventSource l = find(button.getActionListeners());
if (l == null) {
  l = new StagedActionEventSource();

相关文章