Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created October 8, 2013 01:05
Show Gist options
  • Save matiasfha/6877813 to your computer and use it in GitHub Desktop.
Save matiasfha/6877813 to your computer and use it in GitHub Desktop.
Java Swing example
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