Skip to content

Instantly share code, notes, and snippets.

@Daroth
Forked from mdeous/gist:940415
Created April 25, 2011 12:17
Show Gist options
  • Save Daroth/940430 to your computer and use it in GitHub Desktop.
Save Daroth/940430 to your computer and use it in GitHub Desktop.
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
public class MonApplication {
public static void main(String[] args) {
MaFenetre f = new MaFenetre();
f.afficher();
}
}
class MaFenetre {
JFrame mainFrame = null;
public MaFenetre() {
mainFrame = new JFrame();
mainFrame.setTitle("Mon application");
mainFrame.addWindowListener(new WindowAdapter() {
class MonAutreClasse {
class MegaTrucDeOuf {
public void display(String message) {
System.out.println(message);
}
}
public void afficher(String message) {
System.out.println(message);
}
}
public void windowClosing(WindowEvent ev) {
MonAutreClasse mac = new MonAutreClasse();
mac.afficher("message");
System.exit(0);
}
});
mainFrame.setSize(320, 240);
}
public void afficher() {
mainFrame.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment