
import java.awt.*;
import javax.swing.*;

/**
 * When this program is run, it opens a window that
 * displays a simple drawing.
 */
public class MyPicture extends JPanel {

    
    /**
     * This paintComponent() method draws the content of the
     * 800-by-600 drawing area that is displayed in the window.
     */
    protected void paintComponent(Graphics g) {

        g.setColor(Color.WHITE);     // TODO: Maybe use a different color.
        g.fillRect(0, 0, 800, 600);  // Fill the whole drawing area.
        
        // TODO: Draw a picture!
        
    } // end paintComponent()
    

    /**
     * Main method creates and shows the window.  (Do not change it!)
     */
    public static void main(String[] args) {
        JFrame window = new JFrame("My Picture");
        MyPicture canvas = new MyPicture();
        canvas.setPreferredSize(new Dimension(800,600));
        window.setContentPane(canvas);
        window.pack();
        window.setResizable(false);
        window.setLocation(150,80);
        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        window.setVisible(true);
    }
    
}
