Exercises

  1. 22.3 (Enhanced DrawStars app) Modify the DrawStars example in Section 22.5 so that all the stars have Rotate transition animations that execute indefinitely—that is, set each animation’s cycle count to Animation.INDEFINITE.

  2. 22.4 (PolyLine app) Create an app in which, as the user moves the mouse cursor around the window, a Circle and Polyline follow the cursor. The app should appear as shown in Fig. 22.18. There should always be a Circle centered at the current mouse-cursor location, and that location should also be the first point in the Polyline. As you respond to each mouse-move event, use the mouse cursor’s location as the Circle’s new center and insert that location at the beginning of the Polyline’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.