Skip to content

Instantly share code, notes, and snippets.

@jakubkulhan
Created November 6, 2012 19:21
Show Gist options
  • Save jakubkulhan/4026863 to your computer and use it in GitHub Desktop.
Save jakubkulhan/4026863 to your computer and use it in GitHub Desktop.
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