Skip to content

Instantly share code, notes, and snippets.

@JAChapmanII
Forked from Girmrad/gist:1241225
Created September 25, 2011 22:08
Show Gist options
  • Save JAChapmanII/1241233 to your computer and use it in GitHub Desktop.
Save JAChapmanII/1241233 to your computer and use it in GitHub Desktop.
import java.awt.Graphics;
import javax.swing.JComponent;
import javax.swing.JFrame;
class rect extends JComponent {
public static void main(String[] args) {
JFrame window = new JFrame();
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setBounds(30, 30, 300, 300);
window.getContentPane().add(new rect());
window.setVisible(true);
}
public void paint(Graphics g) {
g.drawRect (10, 10, 200, 200);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment