java paint () auto executed?
<pre><code>import java.awt.*;
import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.event.*;
import java.awt.geom.*;
import java.util.*;

public class test extends JFrame implements ActionListener, MouseListener {

    private Vector&lt;String&gt; vlist = new Vector&lt;String&gt; ();
    private int mouseX, mouseY;
    Canvas c = new Canvas();

    public test () {
        setSize(400,400);
        addMouseListener(this);

    }

    public static void main(String[] args) {


        java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                    test frame = new test();
                    //frame.setBackground(Color.yellow); 
                    frame.setVisible(true);
              }
        });
    }

    public void actionPerformed(ActionEvent ae) {

    }

    @Override
    public void paint(Graphics g) {

        Shape circle = new Ellipse2D.Float(100f, 100f, 100f, 100f);
        Graphics2D ga = (Graphics2D)g;
        ga.draw(circle);

    }

    public void move() {

    }

    public void drawCircle(int x, int y) {

    }

    public void mouseClicked(MouseEvent e) {
        repaint();

    }

    public void mouseExited(MouseEvent e) {

    }

    public void mousePressed(MouseEvent e) {
        this.mouseX=e.getX();
        this.mouseY=e.getY();
    }

    public void mouseReleased(MouseEvent e) {

    }

    public void mouseEntered(MouseEvent e) {

    }
}
</code></pre>

<p>i want to write a testing program to learn the graphic programming in java. To run the above code, the circle is automatically drawn. Why the paint() method is auto executed? I the circle to be created when i clicked the mouse.</p>
