J
Justin
I have implemented a mouse listener in a class that extends a JDialog.
I added a JLabel that contains a graphic. When the user clicks on the
JLabel, the mouse clicked method should trigger a method that does
something with the coordinates. However, when I do click, I get a null
pointer exception. It goes to the line where i assign the variable
int xCoor = getMousePosition().x;
however, if i make xCoor a point, that is fine. However again, if I
were try to copy either the x-coordinate or the y coordinate into an
int variable, I will get a null pointer. Myself, being a hella noob,
cannot figure this out.
Thanks for any help....
I added a JLabel that contains a graphic. When the user clicks on the
JLabel, the mouse clicked method should trigger a method that does
something with the coordinates. However, when I do click, I get a null
pointer exception. It goes to the line where i assign the variable
int xCoor = getMousePosition().x;
however, if i make xCoor a point, that is fine. However again, if I
were try to copy either the x-coordinate or the y coordinate into an
int variable, I will get a null pointer. Myself, being a hella noob,
cannot figure this out.
Thanks for any help....