Microsoft SDK for Java

Q184600 FIX: WebBrowser Events Not Being Received Inside Java

The information in this article applies to:

SYMPTOMS

Attempting to call the following methods after hosting a WebBrowser control inside a Java application or applet fails:

   public void BeforeNavigate2(Object pDisp, Variant URL, Variant Flags,
                               ...);
   public void NewWindow2(Object[] ppDisp, boolean[] Cancel);

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

This bug was corrected in the Microsoft® virtual machine (Microsoft VM) contained in the SDK for Java 3.0, VM build 2829.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Install Microsoft® Internet Explorer 4.0x.

  2. Download SDK for Java version 2.0x from http://www.microsoft.com/java/ This link takes you to a site on microsoft.com.

  3. Load the sample JBrowser from the SDK-Java.20x/Samples directory.

  4. Modify JBrowser.Java to implement the following two methods:
   public void BeforeNavigate2(Object pDisp, Variant URL, Variant Flags,
                              Variant TargetFrameName, Variant PostData,
                              Variant Headers, boolean[] Cancel)
   {
        System.out.println("BeforeNavigate2");
   }
public void NewWindow2(Object[] ppDisp, boolean[] Cancel)
   {
      System.out.println("NewWindow2");
   }
  1. Build the JBrowser project using the JVC that ships with the SDK for Java.

  2. You will notice the output in the DOS window from which the JBrowser application is launched. Watch for specified events above:
  3. The above mentioned events are not received.

REFERENCES

You can download all versions of the SDK for Java from the following Web site:

http://www.microsoft.com/java/ This link takes you to a site on microsoft.com

Additional query words:

WebBrowser events java

© 1999 Microsoft Corporation. All rights reserved. Terms of use.