Created
November 6, 2012 19:21
-
-
Save jakubkulhan/4026863 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| public class Main { | |
| public static void main(String[] args) { | |
| SwingUtilities.invokeLater(new Runnable() { | |
| @Override | |
| public void run() { | |
| JPanel p = new HlavniPanel(); | |
| JFrame f = new JFrame(); | |
| f.add(p); // přidá do framu panel | |
| f.setTitle("bla bla"); // nastaví text záhlaví okna | |
| f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // při kliknutí na křížek v záhlaví okna vypne program | |
| f.pack(); // frame se přizpůsobí velikostí svým komponentám | |
| f.setLocationRelativeTo(null); // umístí frame doprostřed obrazovky | |
| f.setVisible(true); // zobrazí frame | |
| } | |
| }); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment