tags:

views:

69

answers:

1

Hi all

I have an applet, and it consist of an CLOSE button which closes the applet and redirects user to the home page. Home page consists 3 frames (Top, Left and Right). Once user clicks on the CLOSE button, the home page is appearing in the right frames, due to this now user has inconsistent view (multiple frames) of the page.

Code written in CLOSE button of the applet.

protected void cancelActionPerformed()
{     
    try
    {    
     String type = "3";
     AppletContext context = getAppletContext();
     context.showDocument(new URL("javascript:goBack(\"" + type + "\")"));
     destroy();
    }
    catch(MalformedURLException ex)
    {
       // System.out.println(ex.getMessage());
    }
}

This is working perfectly in the JRE version 1.6 UPDATES 07 installed in the browser but higher updates of JRE creating this problem.

Kindly suggest if any thing wrong or any suggestion to overcome this situation.

Thank you

Regards

+1  A: 

By default the JRE does not support java.net.URLs with the javascript protocol. So unless a handler has been installed (even though you never use it - horrible API) you will get a java.net.MalformedURLException.

Probably the easiest solution is to use the LiveConnect API to call the JavaScript.

Tom Hawtin - tackline