LJ Archive

Listing 5. Applet that Uses EmailEntry Widget

import java.applet.Applet;
public class EmailApplet extends Applet implements
   EmailEntryListener
   {
   public void init() {
      EmailEntry emailWidget =
         new EmailEntry() ;
      add( emailWidget ) ;
      emailWidget.addEmailEntryListener(
         this ) ;
   }
   public void done( EmailEntryEvent e ) {
      System.out.println(
       "User is DONE. address is: "
          + e.getEmailAddress() ) ;
   }
   public void cancel( EmailEntryEvent e ) {
      System.out.println(
       "User canceled" + e.getSource() );
   }
}
LJ Archive