[Solved] Drawing an unknown number of shapes [closed]


Check out Custom Painting Approaches

It shows the two common ways to do this:

  1. Keep an ArrayList of Objects to paint and then iterate through the List in the paintComponent() method.

  2. Paint directly to a BufferedImage and then just display the BufferedImage.

solved Drawing an unknown number of shapes [closed]