Answered step by step
Verified Expert Solution
Link Copied!

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

  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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Informix Database Administrators Survival Guide

Authors: Joe Lumbley

1st Edition

0131243144, 978-0131243149

More Books

Students also viewed these Databases questions