September 2005
Beginner
576 pages
13h 6m
English
This hour's first project is an applet that displays the string “Saluton mondo!”, the traditional Esperanto greeting that is becoming more traditional by the hour. You'll take a look at how applets are structured by re-creating the Saluton application from Hour 2, “Writing Your First Program,” as a program that can run on a web page.
Load your word processor and create a new file called SalutonApplet.java. Enter the text of Listing 17.1 into the file and save it when you're done.
1: import java.awt.*; 2: 3: public class SalutonApplet extends javax.swing.JApplet { 4: String greeting; 5: 6: public void init() { 7: greeting = "Saluton mondo!"; 8: } 9: 10: public void paint(Graphics ... |
Read now
Unlock full access