Hi Professor and the class, can anybody give me an advice? I compiled DragKing successfully, but when I run it, I get the following exception (right from the beginning, I see only a blank frame appear on my screen) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% ========================== >java DragKing Exception occurred during event dispatching: java.lang.NullPointerException at Drag.paint(DragKing.java:47) at sun.awt.RepaintArea.paint(Unknown Source) at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.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.run(Unknown Source) Exception occurred during event dispatching: ......... Thanks, Marie. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% It's wierd... DragKing worked once (although generating an exception anyway) and = didn't work the following times I ran it. No changes were made to the = code. -Marie. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hi, When I compile ApplicationFrame and DragKing, I get NullPointerException errors. The program, however, still manages to display the sine curve. Utilities.java, on the other hand, won't compile due to a syntax error. I hope you have time to fix them this weekend, Thanks, Zubin Girglani %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Hey Marie, I have the same problem. The exceptions never go away, but the program works. It appears as though it doesn't, but if you maximise the window that pops up, the drawing appears. I hope that helps... Zubin Girglani %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% The error is because DragKing calls super("DragKing v1.0") which tells ApplicationFrame to initialize. In ApplicationFrame's constructor, it calls createUI, which calls setVisible(true). At this point, java tries to draw the frame (calling paint(Graphics g) on DragKing), but mPoints has not been initialized yet. So, it gets a NullPointerException when trying to access mPoints (mPoints[0], mPoints[1], etc...). If you make the first line of the paint method " if( mPoints == null ) return; " (without the quotes) then everything will work fine. Sam %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Just FYI, you'll also want to add a repaint() as the last line in the constructor of DragKing. Or, just click the mouse once after the frame is drawn and the points will appear. Sam %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% My applet was working fine last night, but right now I can see only grey space... and I'm getting an exception: Error loading class: HelloApplet1 java.lang.NoClassDefFoundError java.lang.ClassNotFoundException: HelloApplet1 at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/applet/AppletPanel.securedClassLoad at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.run at java/lang/Thread.run It's wierd, since I didn't make any changes to it since yesterday.....can this be a server problem? (I'm using i5) any thoughts are appreciated. -Marie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Make sure you file is called HelloApplet1.java, the class within it is public and called HelloApplet1, and that you've uploaded the file HelloApplet1.class to the webserver (in the same directory as your html page that loads it). Sam %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% And remember that since i5 is a unix machine, it is case sensitive (I had the same error) Zubin %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Thanks, guys, for help. All you mentioned was correct. I suppose it was a server problem because it worked two hours later without any changes. -Marie %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%