FileDocCategorySizeDatePackage
HelloApplet.javaAPI DocExample2678Wed Apr 19 11:18:40 BST 2000None

HelloApplet

public class HelloApplet extends Applet

Fields Summary
String
message
Constructors Summary
Methods Summary
public voidinit()

	try {
	    // create and initialize the ORB
            ORB orb = ORB.init(this, null);
 
            // get the root naming context
            org.omg.CORBA.Object objRef = 
		orb.resolve_initial_references("NameService");
            NamingContext ncRef = NamingContextHelper.narrow(objRef);
 
            // resolve the Object Reference in Naming
            NameComponent nc = new NameComponent("Hello", "");
            NameComponent path[] = {nc};
            Hello helloRef = HelloHelper.narrow(ncRef.resolve(path));
 
            // call the Hello server object and print results
            message = helloRef.sayHello();

	} catch (Exception e) {
	    System.out.println("HelloApplet exception: " + e.getMessage());
	    e.printStackTrace(System.out);
        }
    
public voidpaint(java.awt.Graphics g)

	g.drawString(message, 25, 50);