//package examples.hello; import java.awt.*; import java.rmi.*; import java.net.*; public class HelloClient { String message = ""; public HelloClient() { try { // Looks up the server using the name server on the host that // the applet came from. Hello obj = (Hello)Naming.lookup("rmi://localhost/HelloServer"); // Calls the sayHello method on the remote object. message = obj.sayHello(); } catch (RemoteException e) { System.out.println("HelloApplet RemoteException caught"); } catch (NotBoundException e) { System.out.println("HelloApplet NotBoundException caught"); } catch (MalformedURLException e) { System.out.println("HelloApplet MalformedURLException caught"); } } public static void main(String args[]) { //init(); HelloClient obj = new HelloClient(); System.out.println("Returned: " + obj.message); }; };