java.awt.AWTEvent
.
EventListener
interface. These are in the package java.awt.event
.
AWTEvent
objects they are sent.
EventListeners
inside itself.
EventListeners
, we can guarantee that they always have the right methods.
WindowEvent
when they're opened, closed, minimized etc.
WindowListener
, and its seven methods.
addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
((Frame)e.getSource()).dispose();
// or
System.exit(0);
}
});