calling addMouseListener in jscript throws ClassCastException

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

    #1

    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

    • Andrew Thompson

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

      On Wed, 15 Sep 2004 13:52:54 +0100, Jim Higson wrote:
      [color=blue]
      > Jon-Paul Dobson wrote:
      >
      > This shouldn't be on c.l.javascript.
      > Java != Javascript[/color]

      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.

      comp.lang.java. javascript

      Best of luck with it.

      --
      Andrew Thompson
      http://www.PhySci.org/codes/ Web & IT Help
      http://www.PhySci.org/ Open-source software suite
      http://www.1point1C.org/ Science & Technology
      http://www.lensescapes.com/ Images that escape the mundane

      Comment

      Working...