下面列出了java.awt.event.WindowEvent#getSource() 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public final void windowOpened(WindowEvent e) {
dlg = (JDialog) e.getSource();
if (!isDispatchThread) {
createTask();
}
RunOffEDTImpl.CancellableFutureTask f;
synchronized(this) {
f = future;
}
//Runnable could theoretically complete before we have set the
//handle, allowing
//the callee to see a CancellableFutureTask with task == null.
//So we block launch until the task has been assigned, which is now
waitForTaskAssignment.countDown();
grayOutMainWindow();
f.task.schedule(0);
startLatch.countDown();
}
@Override
public void windowClosing(final WindowEvent e) {
if (e.getSource() == debugWindow) {
mwShowDebugWindowCheckBox.setSelected(false);
return;
}
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
@Override
public void windowClosed(WindowEvent event) {
Frame frame = (Frame) event.getSource();
Project proj = frame.getProject();
if (frame == proj.getFrame()) {
projectRemoved(proj, frame, this);
}
if (openProjects.isEmpty() && !MacCompatibility.isSwingUsingScreenMenuBar()) {
ProjectActions.doQuit();
}
}
@Override
public void windowClosing(WindowEvent event) {
Frame frame = (Frame) event.getSource();
if ((frame.getExtendedState() & java.awt.Frame.ICONIFIED) == 0) {
mostRecentFrame = frame;
try {
frameLocations.put(frame, frame.getLocationOnScreen());
} catch (Throwable t) {
}
}
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowStateChanged(WindowEvent e)
{
Window window = (Window) e.getSource();
if (window instanceof JFrame)
{
JFrame frame = (JFrame) window;
JRootPane rootPane = frame.getRootPane();
if(rootPane.getUI() instanceof LuckRootPaneUI)
{
LuckRootPaneUI rootPaneUI = (LuckRootPaneUI) rootPane.getUI();
rootPaneUI.getTitlePane().setState(e.getNewState());
}
if (e.getNewState() == JFrame.MAXIMIZED_BOTH)
{
rootPane.setBorder(null);
}
else if (e.getNewState() == JFrame.NORMAL)
{
rootPane.setBorder(UIManager.getBorder(LuckRootPaneUIBundle.FRAME_BORDER));
}
}
}
public void windowClosing(WindowEvent we) {
done = true;
Window w = (Window)we.getSource();
if (setNullOnDispose) {
w.getGraphicsConfiguration().getDevice().setFullScreenWindow(null);
}
w.dispose();
}
public void windowClosing(WindowEvent e) {
if(e.getSource() == this) dispose();
}
@Override
public void windowActivated(WindowEvent event) {
mostRecentFrame = (Frame) event.getSource();
}
public void windowClosing(WindowEvent e) {
if(e.getSource() == this) dispose();
}
public void windowClosing(WindowEvent e) {
if(e.getSource() == this) dispose();
}
/**
* Invoked when a window is in the process of being closed.
* The close operation can be overridden at this point.
*/
public void windowClosing(WindowEvent e) {
if(e.getSource() == this) dispose();
//System.exit(0);
}