I don't usually do this, and I hate when other does... But I found my self spending the last 6 hours to figure out where I wrong.
I rewrote those lines dozen of times, change several approaches, and still couldn't figure out what the hake is wrong!

The issue is as followed:
Clicking on the [Add] button should add additional circle to the panel (starting from x=0,y=0 - top left corner).

currently only the first circle is loaded, the rest is loaded to the arrayList but not to the panel.

Any thoughts?

BallControl:

```
    import javax.swing.*;
import javax.swing.border.LineBorder;
import java.awt.event.*;
import java.awt.*;
import java.util.ArrayList;

public class BallControl extends JPanel {
    private int delay = 10; // Create a timer with delay 1000 ms
    private Timer timer = new Timer(delay, new TimerListener());

    private ArrayList<Ball> balls = new ArrayList<Ball>();
    private JButton jbtSuspend = new JButton("Suspend");
    private JButton jbtResume = new JButton("Resume");
    private JButton jbtAdd = new JButton("Add");
    private JButton jbtRemove = new JButton("Remove");
    private JButton jbtDirection = new JButton("Direction");
    private JScrollBar jsbDelay = new JScrollBar();
    private JPanel jplBalls = new JPanel(new BorderLayout());

    public BallControl() { // Group buttons in a panel
        JPanel panel = new JPanel();
        panel.add(jbtSuspend);
        panel.add(jbtResume);
        panel.add(jbtAdd);
        panel.add(jbtRemove);
        panel.add(jbtDirection);

        balls.add(new Ball());
        // Add panel-ball and buttons to the panel
        jsbDelay.setOrientation(JScrollBar.HORIZONTAL);
        setDelay(jsbDelay.getMaximum());
        timer.setDelay(delay);

        jplBalls.setBorder(new LineBorder(Color.blue));
        jplBalls.setVisible(true);

        setLayout(new BorderLayout());
        add(jsbDelay, BorderLayout.NORTH);
        add(jplBalls, BorderLayout.CENTER);
        add(panel, BorderLayout.SOUTH);     
        timer.start();
        jplBalls.add(balls.get(balls.size()-1));

        // Register listeners
        jbtSuspend.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                timer.stop();
            }
        });
        jbtResume.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                timer.start();
            }
        });
        jbtAdd.addActionListener(new ActionListener() {     
            public void actionPerformed(ActionEvent e) {
                addNewBallToPanel();
                if(jbtRemove.isEnabled()==false)
                    jbtRemove.setEnabled(true);
            }
        });
        jbtRemove.addActionListener(new ActionListener() {      
            public void actionPerformed(ActionEvent e) {
                removeBallFromPanel();
                if (balls.size()==0)
                    jbtRemove.setEnabled(false);
            }
        });
        jbtDirection.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                for(Ball b : balls)
                    b.changeDirection();
            }
        });

        jsbDelay.addAdjustmentListener(new AdjustmentListener() {
            public void adjustmentValueChanged(AdjustmentEvent e) {
                setDelay(jsbDelay.getMaximum() - e.getValue());
                timer.setDelay(delay);
            }
        });
    }

    public void addNewBallToPanel(){
        balls.add(new Ball());
        jplBalls.add(balls.get(balls.size()-1));

    }

    public void paintComponent(Graphics g){
        super.paintComponent(g);
        for (Ball b : balls){
            b.paintComponent(g);
        }
    }

    private class TimerListener implements ActionListener {
        /** Handle the action event */
        public void actionPerformed(ActionEvent e) {
            repaint();
        }
    }

    public void removeBallFromPanel(){
        jplBalls.remove(balls.get(balls.size()-1));
        balls.remove(balls.size()-1);
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }
}

```

Ball:

```
import javax.swing.Timer;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Ball extends JPanel {
    //private int delay = 10; // Create a timer with delay 1000 ms
    //private Timer timer = new Timer(delay, new TimerListener());
    private int x = 0;
    private int y = 0; // Current ball position
    private int radius = 5; // Ball radius
    private int dx = 2; // Increment on ball's x-coordinate
    private int dy = 2; // Increment on ball's y-coordinate
    private Color c;

    public void setC(Color c) {
        this.c = c;
    }

    public Ball() {
        c = new Color((int)(Math.random()*255), (int)(Math.random()*255), (int)(Math.random()*255));
    }

    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(c);
        if (x < radius)
            dx = Math.abs(dx); // Check boundaries
        if (x > getWidth() - radius)
            dx = -Math.abs(dx);
        if (y < radius)
            dy = Math.abs(dy);
        if (y > getHeight() - radius)
            dy = -Math.abs(dy);
        x += dx; // Adjust ball position
        y += dy;
        g.fillOval(x - radius, y - radius, radius * 2, radius * 2);
    }

    public void changeDirection(){
        dx=-dx;
        dy=-dy;
    }
}

```

BounceBallApp:

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

public class BounceBallApp extends JApplet {
    public BounceBallApp() {
        add(new BallControl());
    }

    public void init(){
        this.setSize(500, 300);
    }
}

```