COMP 1123 ASSIGNMENT 6 solved

Original price was: $35.00.Current price is: $30.00.



5/5 - (3 votes)


Write the class BoxCirclePanel which draws a random box and circle. The box is red and placed at a random location inside the panel. The square box also has a random size which is at most the current width of the panel. Similarly with the green circle.
You can find out the current size of the panel with getWidth() and getHeight() which both return an int.
Each time the code is run, the box and circle will be at a different location and have different sizes. The locations/sizes change as the window is re-sized. At times, only a partial box/circle will be shown. It is also possible for one of the box/circle to cover the other. is provided. Please submit both and
Sample run:
Initial window:

After making the window bigger:

The circle is covering the box:


Write and which uses graphical objects (e.g., circles, ovals, squares, rectangles, text, colors, etc.) to draw an interesting picture. Be creative!


PP 4.16 on p. 204. is provided. Write the class IncrementDecrementPanel. Use a constant for the initial value. The panel size is 250 by 50. Submit and
The initial GUI: