UserApplet.

Enterprise Java
Architecting and Designing Scalable, Multitier Systems
by Michael Minh Nguyen
Listing 5. UserApplet.


package com.scalablemultitier;

import java.applet.*;

public class UserApplet extends Applet

{

  private final static String EMPTY_STRING = "";

  User mUser;



  public UserApplet()

  {

  }



  public void start()

  {

    mUser = new User ();

  }



  public String setFirstName (String firstName)

  {

    try

    {

      mUser.setFirstName (firstName);

    }

    catch (Exception exception)

    {

      return exception.getMessage ();

    }

    return EMPTY_STRING;

  }



  public String setMiddleInitial (String middleInitial)

  {

    try

    {

      mUser.setMiddleInitial (middleInitial);

    }

    catch (Exception exception)

    {

      return exception.getMessage ();

    }

    return EMPTY_STRING;

  }



  public String setLastName (String lastName)

  {

    try

    {

      mUser.setLastName (lastName);

    }

    catch (Exception exception)

    {

      return exception.getMessage ();

    }

    return EMPTY_STRING;

  }



  public String setEmail (String email)

  {

    try

    {

      mUser.setEmail (email);

    }

    catch (Exception exception)

    {

      return exception.getMessage ();

    }

    return EMPTY_STRING;

  }

}

About the Author

Michael Minh Nguyen is a senior software engineer at eBuilt Inc. in Irvine, CA. He may be contacted at [email protected].