calling addMouseListener in jscript throws ClassCastException

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon-Paul Dobson

    calling addMouseListener in jscript throws ClassCastException

    Hi,

    We have an applet that implements the MouseListener interface but when
    trying to add the applet to the glasspane of another applet a
    classcastexcept ion 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,
    MouseMotionList ener

    and created within the HTML page using:

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

    The MapListener object is referenced in jscript using:

    var applet = parent.mapFrame .document.MapLi stener;

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

    parent.mapFrame .IMSMap.getGlas sPane().addMous eListener(apple t);

    This line however throws a jscript exception with message
    'java.lang.Clas sCastException: javax.swing.JPa nel' 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.
  • Jim Higson

    #2
    Re: calling addMouseListene r in jscript throws ClassCastExcept ion

    Jon-Paul Dobson wrote:

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


    Comment

    • Edwin Martin

      #3
      Re: calling addMouseListene r in jscript throws ClassCastExcept ion

      Jim Higson wrote:[color=blue]
      > Jon-Paul Dobson wrote:
      >
      > This shouldn't be on c.l.javascript.
      > Java != Javascript[/color]

      Never heard of Java cooperating with JavaScript?

      Read the article carefully before you respond.

      Edwin Martin


      --
      Weblog by Edwin Martin about frontend webdevelopment and related topics

      Comment

      • ashwin
        New Member
        • Feb 2006
        • 1

        #4
        I am facing the same problem. If any one has a solution/workaround, please do let me know.
        I'm using JDK 1.5
        Thanks
        Ashwin

        Comment

        Working...