Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class called Circle // IN JAVA CODE A Circle object knows, at least, its center coordinates and its radius. The Circle object should
-
Create a class called Circle // IN JAVA CODE
- A Circle object knows, at least, its center coordinates and its radius.
- 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.
- The JPanel paintComponent() method should call the draw method for each Circle object
- Have each Circle pick a random number for its radius
- You can also (this is an option) have each Circle object pick its own color.
-
Have each click of the mouse produce a Circle object
- Make sure each Circle object is remembered (in an array or ArrayList or ...)
-
Tracking Mouse Movement
- Provide RadioButtons to determine the behavior of your program. Have a RadioButton for the drawing of Circles as described above
- Have another RadioButton set to track the Mouse movement and connect the dots
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started