FileDocCategorySizeDatePackage
allowUserInteraction.javaAPI DocExample687Thu Apr 03 15:26:10 BST 1997None

allowUserInteraction.java

import java.net.*;

public class allowUserInteraction {

  public static void main(String[] args) {

    URL u;
    URLConnection uc;
    myHttpHandler handler;

    try {
      u = new URL("http://www.ora.com");
      handler = new myHttpHandler();
      uc = handler.openConnection(u);
      if (!uc.getAllowUserInteraction()) {
        uc.setAllowUserInteraction(true);
      }
    }
    catch (MalformedURLException e) {
      System.err.println(e);
    }
    catch (IOException e) {
      System.err.println(e);
    }

  }

}

class myHttpHandler extends sun.net.www.protocol.http.Handler {

  public URLConnection openConnection(URL u) {
    return super.openConnection(u);
  }

}