-
-
Save Daroth/940430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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