By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

calling addMouseListener in jscript throws ClassCastException

P: n/a

We have an applet that implements the MouseListener interface but when
trying to add the applet to the glasspane of another applet a
classcastexception is thrown.

This all seemed to work fine when using JDK1.3.1_08 but since using
JDK1.4.2 it does not work.

The class implementing the mouse listener interface is defined using:

public class MapListener extends JApplet implements MouseListener,

and created within the HTML page using:

<applet width="600" height="0" code="MapListener.class"
name="MapListener" MAYSCRIPT="true"> </applet>

The MapListener object is referenced in jscript using:

var applet = parent.mapFrame.document.MapListener;

and is added to the glass pane of an applet named IMSMap using:

parent.mapFrame.IMSMap.getGlassPane().addMouseList ener(applet);

This line however throws a jscript exception with message
'java.lang.ClassCastException: javax.swing.JPanel' and with name

We are using IE6.0.2800

Any light anybody could shed on this would be very greatfully


Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Jon-Paul Dobson wrote:

This shouldn't be on c.l.javascript.
Java != Javascript
Jul 17 '05 #2

P: n/a
Jim Higson wrote:
Jon-Paul Dobson wrote:

This shouldn't be on c.l.javascript.
Java != Javascript

Never heard of Java cooperating with JavaScript?

Read the article carefully before you respond.

Edwin Martin
Jul 17 '05 #3

P: 1
I am facing the same problem. If any one has a solution/workaround, please do let me know.
I'm using JDK 1.5
Feb 14 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.