Question: Create a class called Circle // IN JAVA CODE A Circle object knows, at least, its center coordinates and its radius. The Circle object should

  1. Create a class called Circle // IN JAVA CODE

    1. A Circle object knows, at least, its center coordinates and its radius.
    2. The Circle object should have a draw(Graphic) method that takes a Graphic object as an argument and uses that Graphic object to draw itself.
    3. The JPanel paintComponent() method should call the draw method for each Circle object
    4. Have each Circle pick a random number for its radius
    5. You can also (this is an option) have each Circle object pick its own color.
  2. Have each click of the mouse produce a Circle object

    1. Make sure each Circle object is remembered (in an array or ArrayList or ...)
  3. Tracking Mouse Movement

    1. Provide RadioButtons to determine the behavior of your program. Have a RadioButton for the drawing of Circles as described above
    2. Have another RadioButton set to track the Mouse movement and connect the dots
    3. you might want to have a reset JButton for both applications that erases the drawing area when clicked

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!