By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,702 Members | 1,760 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,702 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 23 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Jon-Paul Dobson wrote:

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

P: n/a
On Wed, 15 Sep 2004 13:52:54 +0100, Jim Higson wrote:
Jon-Paul Dobson wrote:

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

a) The post mentions JS. It is a problem
of the interaction between Java and Javascript.
The poster might have done well to stress that
though, as I almost fired off a similar response.

b) Please do not set follow-ups to a
different group without mentioning it
in the body of the post. It can lead to
tumultuous confusion.

[ F'Ups *returned* to c.l.js ]

Note to the OP.

This is an arcane problem, and although I do
not usually recommend posting to invalid groups,
I think there is one that might be the best
bet for this problem.

Best of luck with it.

Andrew Thompson Web & IT Help Open-source software suite Science & Technology Images that escape the mundane
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.