1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| public class Appli extends Object implements WindowListener {
public final static void main(String[] args) {
Appli appli = new Appli();
appli.init();
appli.launchWindow();
}
private void init() {
// ouverture socket
}
private void cleanExit() {
// fermeture socket
}
private void launchWindow() {
AppliWindow appWindow = new AppliWindow();
appWindow.addWindowListener(this);
}
public void windowClosed(WindowEvent arg0) {
cleanExit();
}
public void windowOpened(WindowEvent arg0) {}
public void windowClosing(WindowEvent arg0) {}
public void windowIconified(WindowEvent arg0) {}
public void windowDeiconified(WindowEvent arg0) {}
public void windowActivated(WindowEvent arg0) {}
public void windowDeactivated(WindowEvent arg0) {}
} |