Added window closing event, code polish, added more comments
This commit is contained in:
parent
2364ee9c1a
commit
c7c400f206
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user