none
WebBrowser Control does not load Java Applet RRS feed

  • Question

  • Loading a page using a Java Applet into the WebBrowser Control (.NET 2.0) results in a gray box.
    Sample: http://java.sun.com/applets/jdk/1.4/demo/applets/Animator/example1.html

    The applet itself works fine in both, IE and Firefox.

    Any workarounds?
    Tuesday, February 12, 2008 6:22 PM

Answers

  •  

    Hi till_hm,

    As suggested by Sun, the following environment variable needs to be set up:

            JAVA_PLUGIN_WEBCONTROL_ENABLE = TRUE

    For more information, please visit:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4525262

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Monday, February 18, 2008 3:50 AM

All replies

  •  

    Hi till_hm,

    As suggested by Sun, the following environment variable needs to be set up:

            JAVA_PLUGIN_WEBCONTROL_ENABLE = TRUE

    For more information, please visit:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4525262

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Hope this helps.
    Best regards.
    Rong-Chun Zhang

    Monday, February 18, 2008 3:50 AM
  •  till_hm wrote:
    Loading a page using a Java Applet into the WebBrowser Control (.NET 2.0) results in a gray box.
    Sample: http://java.sun.com/applets/jdk/1.4/demo/applets/Animator/example1.html

    The applet itself works fine in both, IE and Firefox.

    Any workarounds?

     

    What version of Visual Studio are you using, and what version of Java? I just created a C# program in VS 2008 (targetting .NET 2.0) that just had a WebBrowser control on a form and loaded the URL you gave - it worked fine. I'm running Java version 1.5.0_12-b04.

     

    However, I've seen problems with other languages (I'm new to C#) and Java applets. But a lot depended on the version of Java, so that's an important part of the equation. Like you, the "problem" applet worked fine in a browser, but failed in a program that had an embedded browser. Java 6 was particularly bad.

    Monday, February 18, 2008 5:46 PM
  • I had the same problem and when searching the net found this post (I also found this post linked from this post http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/60b88296-2441-4451-bb9c-0ee81a677273 )

    My problem got fixed by compiling my code specifically for x86 (Instead of "Any CPU")
    • Proposed as answer by CodeHxr Tuesday, November 14, 2017 4:56 PM
    Thursday, August 6, 2009 8:31 PM
  • I was having the same problem with the webbrowser control and VS 2008 running on Windows 7 64bit.. compiling the app for x86 instead of "Any CPU" fixed the problem.. 

     

    • Proposed as answer by VinceD Friday, September 28, 2012 1:26 AM
    Monday, October 17, 2011 5:30 PM
  • ghendric...

    You suggested...

    "I was having the same problem with the webbrowser control and VS 2008 running on Windows 7 64bit.. compiling the app for x86 instead of "Any CPU" fixed the problem.. "

    This is the correct answer.  7 hours of groping and finally stumbled into your reply.  Recompiled for x86 and it worked.

    You sir are a godly god!

    Edit to add:  This was using VS 2012 on Windows 8 with Java 7.7 so this is as up-to-date as possible at this writing.

    Edit 1 more time:  There is also a checkbox just below the CPU to target that reads "prefer 32 bit".  That will also correct this.

    • Edited by VinceD Friday, September 28, 2012 1:36 AM
    Friday, September 28, 2012 1:25 AM