You can create an object with the Square position and dimensions, put that Object in an Array and then draw what's inside the Array. Then, you can delete your Object if you want. (Dont forget to clear your screen)

The method you used dont create an Object, it just draw it.

So yes, you can "delete" your object on the screen by clearing your screen, or drawing something else over your Square.

While programming my game "Doode" I realized that the code was confusing, tangled, and I do not know how or where to start

I want to first create a constructor method that creates as many times wanted a JButton, which itself will react to user input ...

Because in fact, right now, my code was creating multiple constiste JButton "DoodeVert1", "DoodeVert2" ... and this is the wrong solution if I want to create 50 (especially the part's name, nothing should change.)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org