Skip to content

Instantly share code, notes, and snippets.

@seanh

seanh/MyClass.java

Created May 25, 2009
Embed
What would you like to do?
Get a Swing GUI up and running. (Handy for testing swing components.)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class MyClass {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Container contentPane = frame.getContentPane();
contentPane.setLayout( ... );
contentPane.add( ... );
f.pack();
f.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.