Question: Write a program that draws a fixed rectangle centered at (100, 60) with width 100 and height 40. Whenever the mouse is moved, display a
Write a program that draws a fixed rectangle centered at (100, 60) with width 100 and height 40. Whenever the mouse is moved, display a message indicating whether the mouse point is inside the rectangle at the mouse point or outside ?of it, as shown in Figure 15.27b. To detect whether a point is inside a polygon, use the contains method defined in the Node class.
Mouse point is outside the rectangle (b)
Step by Step Solution
3.46 Rating (159 Votes )
There are 3 Steps involved in it
Program Plan The program defines a UI for the user with the rectangle placed at the desired location ... View full answer
Get step-by-step solutions from verified subject matter experts
