return to first page linux journal archive
keywordscontents

Listing 2. EmailEntryEvent Class

import java.awt.* ;
class EmailEntryEvent  extends  AWTEvent {
	private static final int DONE = 1 ;
	private static final int CANCEL = 2 ;
	private String _emailAddress = "" ;
	private int _type ;
	public EmailEntryEvent( Object source, 
			String s ) {
		// use this constructor when the
		// user is "done"
		super( source , 0 ) ;
		_type = DONE ;
		_emailAddress = s ;
	}
	public EmailEntryEvent( Object source ) {
		// use this constructor when the
		// user "cancelled"
		super( source , 0 ) ;
		_type=CANCEL ;
		_emailAddress = "" ;
	}
	public boolean isDone() {
		return _type == DONE ;
	}
	public String getEmailAddress() {
		return _emailAddress ;
	}
}