本文整理了Java中javax.swing.JFrame.getListeners()
方法的一些代码示例,展示了JFrame.getListeners()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JFrame.getListeners()
方法的具体详情如下:
包路径:javax.swing.JFrame
类名称:JFrame
方法名:getListeners
暂无
代码示例来源:origin: JChemPaint/jchempaint
/**
* Closes all currently opened JCP instances.
*/
public static void closeAllInstances() {
int instancesNumber = instances.size();
for (int i = instancesNumber - 1; i >= 0; i--) {
JFrame frame = (JFrame) instances.get(i).getTopLevelContainer();
WindowListener[] wls = (WindowListener[]) (frame
.getListeners(WindowListener.class));
wls[0].windowClosing(new WindowEvent(frame,
WindowEvent.WINDOW_CLOSING));
}
}
代码示例来源:origin: com.github.tntim96/rhino
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
final EventListener[] l =
frame.getListeners(WindowListener.class);
frame.removeWindowListener((WindowListener)l[0]);
frame.addWindowListener(new WindowAdapter() {
代码示例来源:origin: com.github.houbie/rhino-mod
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
final EventListener[] l =
frame.getListeners(WindowListener.class);
frame.removeWindowListener((WindowListener)l[0]);
frame.addWindowListener(new WindowAdapter() {
代码示例来源:origin: org.jvnet.hudson/embedded-rhino-debugger
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
final EventListener[] l =
frame.getListeners(WindowListener.class);
frame.removeWindowListener((WindowListener)l[0]);
frame.addWindowListener(new WindowAdapter() {
代码示例来源:origin: ro.isdc.wro4j/rhino
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
final EventListener[] l =
frame.getListeners(WindowListener.class);
frame.removeWindowListener((WindowListener)l[0]);
frame.addWindowListener(new WindowAdapter() {
内容来源于网络,如有侵权,请联系作者删除!