Exercises
22.3 (Enhanced
DrawStars
app) Modify theDrawStars
example in Section 22.5 so that all the stars haveRotate
transition animations that execute indefinitely—that is, set each animation’s cycle count toAnimation.INDEFINITE
.22.4 (
PolyLine
app) Create an app in which, as the user moves the mouse cursor around the window, aCircle
andPolyline
follow the cursor. The app should appear as shown in Fig. 22.18. There should always be aCircle
centered at the current mouse-cursor location, and that location should also be the first point in thePolyline
. As you respond to each mouse-move event, use the mouse cursor’s location as theCircle
’s new center and insert that location at the beginning of thePolyline
’s points collection. The
Get Java How To Program, Late Objects, 11th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.