I have the following code:
Graphics canvasGraphics
canvasGraphics.drawLine(x, y, 200, 200);
which works fine on a machine. But on another machine, I receive the
following error messages.
===============
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at pan$1.mouseClicked(pan.java:82)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
+++++======================
Why do I get this
Andrew Thompson - 01 Apr 2007 07:48 GMT
> I have the following code:
>
> Graphics canvasGraphics
> canvasGraphics.drawLine(x, y, 200, 200);
That code does not compile.
> which works fine on a machine.
No it wouldn't. It would not even compile.
Please stop wasting your time, and our bandwdidth,
posting snippets of code that do not express the
problem.
I recommend you prepare an SSCCE that shows the
same behaviour, and post that instead.
<http://www.physci.org/codes/sscce.html>
Andrew T.