Created
September 25, 2011 22:01
-
-
Save Girmrad/1241225 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 java.awt.Graphics; | |
import javax.swing.JComponent; | |
import javax.swing.JFrame; | |
class rect extends JComponent { | |
public static void main(String[] args) { | |
public void paint(Graphics g) { | |
g.drawRect (10, 10, 200, 200); | |
} | |
} | |
} | |
class DrawRect { | |
public static void main(String[] a) { | |
JFrame window = new JFrame(); | |
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
window.setBounds(30, 30, 300, 300); | |
window.getContentPane().add(new MyCanvas()); | |
window.setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rect.java:10: error: illegal start of expression
public void paint(Graphics g) {
^
rect.java:10: error: illegal start of expression
public void paint(Graphics g) {
^
rect.java:10: error: ';' expected
public void paint(Graphics g) {
^
rect.java:10: error: ';' expected
public void paint(Graphics g) {