posted 16 years ago
Hi, here's greenhorn nbr1!
I would like to compile the following code, but get 5 errors.
Here's the code, then follows the compiler's output. Can you help me to troubleshoot?
Thanks, Patrick
Code:
import java.awt.*;
import javax.swing.*;
class MeinZeichenPanel extends JPanel {
public void paintComponent(Graphics g);
g.setColor(Color.orange);
g.fillRect(20,50,100,100);
} // end of PaintComponent
} // end of class MeinZeichenPanel
Compiler Output:
MeinZeichenPanel.java:6: <identifier> expected
g.setColor(Color.orange);
^
MeinZeichenPanel.java:6: <identifier> expected
g.setColor(Color.orange);
^
MeinZeichenPanel.java:7: <identifier> expected
g.fillRect(20,50,100,100);
^
MeinZeichenPanel.java:7: illegal start of type
g.fillRect(20,50,100,100);
^
MeinZeichenPanel.java:9: class, interface, or enum expected
} // end of class MeinZeichenPanel→
^
5 errors