It's not a secret anymore!
The moose likes Applets and the fly likes problem of applet in Netscape 6.2 while usinf JSObject Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Reply locked New topic

problem of applet in Netscape 6.2 while usinf JSObject

Venkata Ramana

Joined: Feb 14, 2002
Posts: 17
I am trying to call javascript method in java(in my applet)
here i wrote the jsp page and i used
<jsp lugin> tag for applet. This is working fine with IE6.0 and Netscape4.6. but with the latest version of Netscape(6.2) i am getting the following exception
netscape.javascript.JSException: JSObject.getWindow() requires mayscript attribute on this Applet at java.lang.reflect.Constructor.newInstance(Native Method) at Source)
at Method)at sun.plugin.liveconnect.SecureInvocation.ConstructObject(Unknown Source)
I am adding my applet code and jsp code.
In my applet there is button, by clicking the button it will calls the javascript method and closes the browser window.
Applet class:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import netscape.javascript.JSObject;
import netscape.javascript.*;
import javax.swing.colorchooser.AbstractColorChooserPanel;

public class JSoTest extends JApplet implements ActionListener
JButton btn;
JPanel p1;
Color clr;
public JSoTest()
public void init()
btn=new JButton("Close");
p1=new JPanel();
this.getContentPane().setLayout(new BorderLayout());
public void actionPerformed(ActionEvent e)
JSObject obj=JSObject.getWindow(this);"close",null);
catch(Exception ex)

jsp page:

<body >
<jsp lugin type="applet" code="JSoTest.class" codebase="/examples/jsp/plugin/applet/"
width="200" height="150" name="Fractal">
<jsp arams>
<jsp aram name="MAYSCRIPT" value="true" />
</jsp arams>
<p>Unable to load java plugin</p>
</jsp lugin>

If i write the html file and with embed tag it is working fine.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Please do not cross post. Continue the conversation here.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: problem of applet in Netscape 6.2 while usinf JSObject
It's not a secret anymore!