Skip to content

Instantly share code, notes, and snippets.

@andrewfree
Created March 5, 2011 00:10
Show Gist options
  • Save andrewfree/855951 to your computer and use it in GitHub Desktop.
Save andrewfree/855951 to your computer and use it in GitHub Desktop.
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class MainClass extends JPanel {
public MainClass() {
JLabel lblMarried = new JLabel("Are you married?", JLabel.LEFT);
JLabel lblGolf = new JLabel("Do you play golf?", JLabel.RIGHT);
add(lblMarried);
add(lblGolf);
}
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.getContentPane().add(new MainClass());
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(200, 200);
frame.setVisible(true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment