Question: Lab # 2 - Circle Lab Requirements Design and implement an application that draws a circle using a rubberbanding technique. The circle size is determined
Lab # Circle
Lab Requirements
Design and implement an application that draws a circle using a rubberbanding technique.
The circle size is determined by a mouse drag.
Use the original mouse click location as a fixed center point.
The mouse location during the drag should be on the outside of the circle.
Hints drawOval
You'll have to research the drawOval method on your own. Google is your friend :
Search for "How to draw a circle in Java" and see what you find. There are issues with the xy coordinated you will have available to you and the xy coordinates that are used with drawOval.
You will have to have the program perform some calculations to get the circle to draw in the correct place.
Compute the distance between the mouse pointer and the center point use the distance formula to determine the current radius of the circle.
Start with the following example code. Click to Download RubberLines.zipopens in a new tab example
Use the following names for your files:
CirclePanel.java
Circle.java
red circle
Place your class files for Lab # in a folder named LCircle.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
