$PKGLINE import java.applet.Applet; import java.awt.*; import java.awt.event.*; /** * Describe the Applet * * @author * @version */ public class $CLASSNAME extends Applet implements ActionListener { // sample awt objects private TextField name = new TextField("Type your name here!"); private Button pressMe = new Button("Press me!"); private Label greeting = new Label("The message will appear here"); /** * Add objects to the Applet */ public void init() { add(name); add(pressMe); add(greeting); // Causes button presses to be detected pressMe.addActionListener(this); } /** * When an event occurs on an object with an ActionListener attached, this * method is carried out. * * @param e carries details about the event that occurred */ public void actionPerformed(ActionEvent e) { // sample action... greeting.setText("Hello " + name.getText()); } }