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() );
}
}
Copyright © 1994 - 2018 Linux Journal. All rights reserved.