本文整理了Java中java.awt.Button.getActionListeners()
方法的一些代码示例,展示了Button.getActionListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Button.getActionListeners()
方法的具体详情如下:
包路径:java.awt.Button
类名称: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();
内容来源于网络,如有侵权,请联系作者删除!