Created
October 8, 2013 01:05
-
-
Save matiasfha/6877813 to your computer and use it in GitHub Desktop.
Java Swing example
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
package com.zetcode; | |
import javax.swing.JFrame; | |
import javax.swing.SwingUtilities; | |
public class SimpleExample extends JFrame { | |
public SimpleExample() { | |
setTitle("Simple example"); | |
setSize(300, 200); | |
setLocationRelativeTo(null); | |
setDefaultCloseOperation(EXIT_ON_CLOSE); | |
} | |
public static void main(String[] args) { | |
SwingUtilities.invokeLater(new Runnable() { | |
@Override | |
public void run() { | |
SimpleExample ex = new SimpleExample(); | |
ex.setVisible(true); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment