Workshop: Revolving Links

Now that all aspects of the Revolve applet have been described, you're ready to create the program and test it. Run your word processor and create a new file called Revolve.java. Enter the text of Listing 19.2 and save the file when you're done.

Listing 19.2. The Full Text of Revolve.java
 1: import java.applet.*; 2: import java.awt.*; 3: import java.awt.event.*; 4: import javax.swing.*; 5: import java.net.*; 6: 7: public class Revolve extends JApplet 8: implements Runnable, ActionListener { 9: 10: String[] pageTitle = new String[6]; 11: URL[] pageLink = new URL[6]; 12: Color butterscotch = new Color(255, 204, 158); 13: int current = 0; 14: Thread runner; 15: 16: public void init() { 17: pageTitle[0] = "Sun's Java site"; ...

Get SAMS Teach Yourself Programming with Java™ in 24 Hours, FOURTH 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.