calling addMouseListener in jscript throws ClassCastException

J

Jon-Paul Dobson

Hi,

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,
MouseMotionListener

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().addMouseListener(applet);

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

We are using IE6.0.2800

Any light anybody could shed on this would be very greatfully
received.

Thanks,

Jon-Paul.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top