I have my program that can draw rectangles. I have two problems I can\'t solve. After I draw the rectangle it won\'t stay. The only code I have that clears the canvas in und
Read up on these two Custom Painting Approaches. One approach is described above and the second approach shows how to use a BufferedImage. The example used for both approaches allows you to add multiple Rectangles to the frame.