本文整理汇总了Java中java.awt.event.WindowListener.windowOpened方法的典型用法代码示例。如果您正苦于以下问题:Java WindowListener.windowOpened方法的具体用法?Java WindowListener.windowOpened怎么用?Java WindowListener.windowOpened使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.event.WindowListener
的用法示例。
在下文中一共展示了WindowListener.windowOpened方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: open
import java.awt.event.WindowListener; //导入方法依赖的package包/类
public boolean open () {
dd = new DialogDescriptor(panel, NbBundle.getMessage(RevisionPicker.class, "LBL_RevisionPickerDialog.title"), //NOI18N
true, new Object[] { okButton, DialogDescriptor.CANCEL_OPTION }, okButton, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx("org.netbeans.modules.git.ui.repository.RevisionPickerDialog"), null); //NOI18N
Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);
updateDialogState();
browserPanel.addPropertyChangeListener(this);
Preferences prefs = GitModuleConfig.getDefault().getPreferences();
WindowListener windowListener = new DialogBoundsPreserver(prefs, this.getClass().getName());
dialog.addWindowListener(windowListener);
windowListener.windowOpened(new WindowEvent(dialog, WindowEvent.WINDOW_OPENED));
dialog.pack();
updateSliders(prefs);
dialog.setVisible(true);
persistSliders(prefs);
browserPanel.removePropertyChangeListener(this);
return dd.getValue() == okButton;
}
示例2: processWindowEvent
import java.awt.event.WindowListener; //导入方法依赖的package包/类
protected void processWindowEvent(WindowEvent e) {
for (Iterator<?> i = windowListeners.getUserIterator(); i.hasNext();) {
WindowListener listener = (WindowListener) i.next();
switch (e.getID()) {
case WindowEvent.WINDOW_ACTIVATED:
listener.windowActivated(e);
break;
case WindowEvent.WINDOW_CLOSED:
listener.windowClosed(e);
break;
case WindowEvent.WINDOW_CLOSING:
listener.windowClosing(e);
break;
case WindowEvent.WINDOW_DEACTIVATED:
listener.windowDeactivated(e);
break;
case WindowEvent.WINDOW_DEICONIFIED:
listener.windowDeiconified(e);
break;
case WindowEvent.WINDOW_ICONIFIED:
listener.windowIconified(e);
break;
case WindowEvent.WINDOW_OPENED:
listener.windowOpened(e);
break;
}
}
}