September 2005
Beginner
576 pages
13h 6m
English
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.
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"; ... |
Read now
Unlock full access