Question: Write an applet that initially displays Computer Programming II in the center of a window. The sentence should follow your mouse cursor when you move
Write an applet that initially displays Computer Programming II in the center of a window. The sentence should follow your mouse cursor when you move the cursor inside the window. Your starting coordinate to print the sentence should be (50, 50). Try out your applet. If time permits, create a web page on which you can display your applet. Submit your .java file (and .html file if you have)
Your starting applet should display similar to following figure:
You do not need to create object of MouseListener class, hence you do not need to implement MouseListener class. You only object of MouseMotionListener class. For this application, you need mouseMoved method which get the mouse pointer's X and Y coordinates; and force the paint method to execute. You can keep mouseDragged method empty.
Applet Viewer: Ali Applet Computer Programming Applet started
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
