// ConnectionManagerClientApplet.java -- clients for network connection manager // // author : Scott W. Matey // import java.awt.*; import java.applet.*; import java.io.*; import java.net.*; import java.util.Enumeration; public class ConnectionManagerClientApplet extends Applet { public String name; // subclasses must initialize this! public boolean proxy = false; ConnectionManagerApplet manager; public void close () { } // override this to process input from server public void notifyInput (String s) { } // send output to server; no need to override this. public void sendOutput (String s) { if (manager == null) findmanager (); manager.sendOutput (this, s); } void findmanager () { for (Enumeration e = getAppletContext().getApplets(); e.hasMoreElements() ;) { Applet a = (Applet)(e.nextElement()); if (Utilities.isInstance (a, "ConnectionManagerApplet")) { manager = (ConnectionManagerApplet) a; break; } } if (manager == null) System.err.println ("Applet " + name + " could not find ConnectionManagerApplet\n"); } }