本文整理了Java中java.awt.Toolkit.getAWTEventListeners()
方法的一些代码示例,展示了Toolkit.getAWTEventListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolkit.getAWTEventListeners()
方法的具体详情如下:
包路径:java.awt.Toolkit
类名称:Toolkit
方法名:getAWTEventListeners
[英]Returns an array of all the AWTEventListener
s registered on this toolkit.
First, if there is a security manager, its checkPermission
method is called with an AWTPermission("listenToAllAWTEvents")
permission. This may result in a SecurityException.
Listeners can be returned within AWTEventListenerProxy
objects, which also contain the event mask for the given listener. Note that listener objects added multiple times appear only once in the returned array.
[中]返回在此工具包上注册的所有AWTEventListener
的数组。
首先,如果有一个安全管理器,它的checkPermission
方法将被调用,并具有AWTPermission("listenToAllAWTEvents")
权限。这可能会导致SecurityException
监听器可以在AWTEventListenerProxy
对象中返回,该对象还包含给定监听器的事件掩码。请注意,多次添加的侦听器对象在返回的数组中只出现一次。
代码示例来源:origin: joel-costigliola/assertj-swing
private void removePrevious() {
AWTEventListener[] listeners = toolkit.getAWTEventListeners(EVENT_MASK);
for (AWTEventListener listener : listeners) {
if (listener instanceof EmergencyAbortListener) {
toolkit.removeAWTEventListener(listener);
}
}
}
代码示例来源:origin: UISpec4J/UISpec4J
public AWTEventListener[] getAWTEventListeners() {
return getUnderlyingToolkit().getAWTEventListeners();
}
代码示例来源:origin: UISpec4J/UISpec4J
public AWTEventListener[] getAWTEventListeners(long eventMask) {
return getUnderlyingToolkit().getAWTEventListeners(eventMask);
}
代码示例来源:origin: stackoverflow.com
public void eventDispatched(AWTEvent event) {
System.out.println("-----------------------");
for (AWTEventListener listener : Toolkit.getDefaultToolkit().getAWTEventListeners()) {
System.out.println(listener);
内容来源于网络,如有侵权,请联系作者删除!