Skip to content
Advertisement

Tag: rectangles

How can you draw rectangles on a JPanel?

I’m trying to create a program that generates rectangles using a slider. The user should be able to move the slider and rectangles should appear on the JPanel above the slider with random positions. I have tried running the program but I’m still unable to display anything, I move the slider but nothing appears on screen. I have tried coding

Advertisement