I want to add circle on my `JFrame` every time that I click on a button the code should add another circle on frame but as I use the `repaint()` method it always draw one circle.

```
public void paint(Graphics g){
    super.paintComponents(g);

    Graphics2D g2= (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    Ellipse2D.Double circle = new Ellipse2D.Double();
    circle.width=50;
    circle.height=50;
    circle.x=getX();
    circle.y=getY();
    g2.draw(circle);
}

public static void main(String args[]){
    new PaintComponents();
}

@Override
public void actionPerformed(ActionEvent e) {
    if(e.getSource()==bt){
        String s=JOptionPane.showInputDialog("enter a number");
        if(getX()==0){
        setX(100);
        setY(200);
        repaint();
        }
        else {
            setX(200);
            setY(200);
            repaint();
        }
    }
}

```

Here is the code. I want to add many circles. What should I do?

In this question my goal is to make a BST tree graphically by circles and line but I don't know how to add circles. I should show the Nodes in Jframe as circles step by step I mean that every time I add a node with an object it should make circle in the right location. How can I do this?