Created
March 5, 2011 00:10
-
-
Save andrewfree/855951 to your computer and use it in GitHub Desktop.
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
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