import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import javax.swing.JApplet;
import javax.swing.JLabel;

public class ClientApplet extends JApplet
{
    public void init()
    {
        try
        {
            Registry registry = 
                LocateRegistry.getRegistry(getCodeBase().getHost(), RemoteInterface.REGISTRY_PORT);
            RemoteInterface remoteReference = 
                (RemoteInterface) registry.lookup(RemoteInterface.REGISTRY_NAME);
            getContentPane().add(new JLabel(remoteReference.getMessage()));
        }
        catch (Exception e)
        {
            throw new RuntimeException(e);
        }
    }
}
