logo

Swing Turtles Follow Mouse

   

Added on  2019-09-16

2 Pages207 Words177 Views
 | 
 | 
 | 
ObjectivesIn the assignment you will gain experience with the following:SwingEvent handling in SwingSwing TimersIn this assignment you will create an application where the turtle follows the mouse pointerImportant Note: Be sure to add the mouse listeners to the EndWorld directly NOT the frame!Here is the beginning of the UML class diagram that you must implement. Omitted are other classes(anonymous or otherwise) for event handling.HintsThere are 2 different interfaces you will need for handling mouse events.1.As noted above you need to have the turtle start/stop moving based on1.Whether it is already at the position of the mouse2.If the mouse pointer is in the drawing area. This latter one can be handled by using thePointobject that theTurtleMouseFollowerhas. In my implementation I initially setit tonulland reset it tonullwhen the mouse exits the drawing area.
Swing Turtles Follow Mouse_1

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents