FileDocCategorySizeDatePackage
ShowHTML.javaAPI DocExample3329Mon Apr 06 18:10:22 BST 1998None

ShowHTML

public class ShowHTML extends Applet

Fields Summary
static final String
CGIProgram
Button
send
Label
l
Constructors Summary
Methods Summary
public booleanaction(java.awt.Event evt, java.lang.Object arg)

    if(evt.target.equals(send)) {
      try {
        // This could be an HTML page instead of
        // a CGI program. Notice that this CGI 
        // program doesn't use arguments, but 
        // you can add them in the usual way.
        URL u = new URL(
          getDocumentBase(), 
          "cgi-bin/" + CGIProgram);
        // Display the output of the URL using
        // the Web browser, as an ordinary page:
        getAppletContext().showDocument(u);
      } catch(Exception e) {
        l.setText(e.toString());
      } 
    }
    else return super.action(evt, arg);
    return true;
  
public voidinit()

     
    add(send);
    add(l);