After our first Java Workshop, I did some practicing at home. First, I recreated what we did in the workshop.
Then I played around to see what I would be able to do. So, I ended up creating a rectangle I could draw in. As soon as the mouse leaves the rectangle, it stops drawing circles and once it is clicked, the canvas will clear.
I then added another rectangle, I could draw in. This time I used a smaller rectangle as my “brush”.
But doing that, I ran into a problem. As soon as I would click, both of my rectangle-windows would clear.
So, I tried around a little bit and actually ended up finding a solution. There probably is a better way to do it, but that is what I did: