I am trying to draw a rectangle onto a pane. My program will compile
and run but the rectangle does not seem to get drawn. When the program
is run the program frame opens up, but I cannot see a rectangle on the
pane.
Any help would be appreciated.
Sincerely,
Allan
====start class code=====
import java.awt.*;
import javax.swing.*;
class MyDrawPanel extends JPanel {
public static void main(String[] args) {
MyDrawPanel gui = new MyDrawPanel();
gui.go();
}//close main
public void go() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
frame.setSize(300,300);
frame.setVisible(true);
}//close go
public void paintComponet(Graphics g) {
g.setColor(Color.orange);
g.fillRect(20,50,100,100);
}//close paintComponent
}//close class
======end class code======