Added window closing event, code polish, added more comments

This commit is contained in:
nathan 2016-10-04 23:24:01 +02:00
parent 2364ee9c1a
commit c7c400f206

View File

@ -19,15 +19,24 @@ import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
class NotifyPopupWindowAdapter extends WindowAdapter {
public
void windowClosing(WindowEvent e) {
if (e.getNewState() != WindowEvent.WINDOW_CLOSED) {
NotifyPopup source = (NotifyPopup) e.getSource();
source.close();
}
}
public
void windowLostFocus(WindowEvent e) {
if (e.getNewState() != WindowEvent.WINDOW_CLOSED) {
NotifyPopup source = (NotifyPopup) e.getSource();
// these don't work
//toFront();
//requestFocus();
//requestFocusInWindow();
source.setAlwaysOnTop(false);
source.setAlwaysOnTop(true);
//requestFocusInWindow();
}
}
}