本文整理汇总了Java中java.awt.event.WindowEvent.getWindow方法的典型用法代码示例。如果您正苦于以下问题:Java WindowEvent.getWindow方法的具体用法?Java WindowEvent.getWindow怎么用?Java WindowEvent.getWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.WindowEvent
的用法示例。
在下文中一共展示了WindowEvent.getWindow方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: windowClosing
import java.awt.event.WindowEvent; //导入方法依赖的package包/类
@Override
public void windowClosing(WindowEvent e) {
if (e.getWindow() instanceof MainView) {
this.model.logToFile(this.controller.getLogToFile());
this.settings.saveSettings(this.provider);
this.controller.setStop(true);
e.getWindow().dispose();
}
}
示例2: windowClosing
import java.awt.event.WindowEvent; //导入方法依赖的package包/类
public void windowClosing(WindowEvent e) {
e.getWindow().setVisible(false);
e.getWindow().dispose();
if ( !(e.getWindow() instanceof Frame))
return;
((Frame)e.getWindow()).setMenuBar(null);
((Frame)e.getWindow()).removeAll();
}
示例3: windowActivated
import java.awt.event.WindowEvent; //导入方法依赖的package包/类
public void windowActivated(WindowEvent e) {
logger.entering(getClass().getName(), "windowActivated");
WeakReference<RootPaneContainer> ww = getWeak((RootPaneContainer)e.getWindow());
if (ww != null) {
// place as last item in zOrder list
zOrder.remove(ww);
zOrder.add(ww);
} else {
throw new IllegalArgumentException("Window not attached: " + e.getWindow()); //NOI18N
}
}