Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Beginning with the file that you downloaded named Proj 0 8 . java, make a file named Proj 0 8 Runner.java to meet the specifications

Beginning with the file that you downloaded named Proj08.java, make a file named Proj08Runner.java to meet the specifications given below.
Note that you must not modify the code in the file named Proj08.java.
Proj08.java
/*File Proj08.java
The purpose of this assignment is to assess the student's
ability to make a program dealing with Frame objects,
MouseMoved events, MouseDragged events, and the Delegation
Event Model.
**********************************************************/
import java.awt.Frame;
public class Proj08{
public static void main(String[] args){
Frame aFrame = new Proj08Runner();
}//end main
}//end class Proj08
Be sure to display your name in both locations in the output as indicated.
When you place both files in the same folder, compile them both, and run the file named Proj08.java, the program must display the text shown below on the command line screen.
I certify that this program is my own work and is not the work of others. I agree not to share my solution with others. Replace this line with your name
In addition, your program must display a single 300-pixel by 100-pixel Frame object as shown in the image below in the upper-left corner of the screen.
When you move your mouse pointer around inside the client area of the frame, without pressing either mouse button, the coordinates of the mouse pointer must appear directly above and to the right of the tip of the pointer. In this case, the coordinates are displayed using black characters. Old coordinates must be erased before new coordinates are displayed.
When you move your mouse pointer around inside the client area of the frame, while pressing either mouse button, the coordinates of the mouse pointer are displayed in the same manner using red characters.
If you slowly move the mouse pointer off the left side of the Frame, the coordinate values should freeze with the x-coordinate value being approximately equal to the width of the left border of the Frame. That value might be as low as 3 but should never be 0 and probably should not be as low as 1 or 2. Depending on the Java version and the operating system, it may be much higher. Right now, the lowest value being reported on my computer is 7.
If you slowly move the mouse pointer off the bottom of the Frame, the coordinate values should freeze with the y-coordinate value being approximately equal to 100 minus the width of the bottom border of the Frame. That value should never be 100 and probably should never be greater than 97. Depending on the Java version and the operating system, it may be much lower. Right now, the maximum value being reported on my computer is 92.
If you aren't getting similar results, please discuss the matter with your instructor before you submit the assignment.
When you click the [ X ] button (the right-most button in the group of 3 buttons in the upper-right corner of the Frame object), the program must terminate and MUST RETURN CONTROL TO THE OPERATING SYSTEM.
image text in transcribed

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

Database Design And Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions