Hi HardC0d3r,

hardc0d3r <[EMAIL PROTECTED]> wrote on 05/06/2007 12:15:56 PM:

>     public void registerListeners(JLabel target) {
>         //this label provides feedback on the selected item
>         this.target = target;
>         // Gets an element from the loaded document.
>         // document is your SVGDocument
>         Element elt = 
canvas.getSVGDocument().getElementById("glasspane");
>         EventTarget t = (EventTarget)elt;
>         t.addEventListener("click", new GlassPaneClick(), false);
> 
>         Element elt2 = 
canvas.getSVGDocument().getElementById("rectangles");
>         EventTarget t2 = (EventTarget)elt2;
>         t2.addEventListener("click", new ObjectClick(), false);

> i don't know what's wrong. i get the error 
java.lang.NullPointerException in
> the line:
>       t2.addEventListener("click", new ObjectClick(), false);
> 
> why am i having these errors?

   Probably because it can't find "rectangles" in the document.
Since the source you sent didn't include how you called the
add methods or the registerListeners it's hard to know why.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to