http://www.compadre.org/OSP/items/detail.cfm?ID=9414
when i move the compass very quickly, sometimes it is possible to get a runtime error.
any idea how the error can be solved?
I tried to fix it but can't figure out the cause, i increase the array to nx and ny to [21] but that didn't solve the runtime error.
i have been puzzled by this runtime error. i can't understand what is causing it. chance to look at it ? thanks!

"Where is "Thread-3"? this error position happen at this point, i did a screen capture[img]http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1576.0;attach=2137;image[/img][img]http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1576.0;attach=2139;image[/img]

Error is:
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: 20
at org.opensourcephysics.drawing2d.VectorField.prepareField(Unknown Source)
at org.opensourcephysics.drawing2d.VectorField.draw(Unknown Source)
at org.opensourcephysics.display.DrawingPanel.paintDrawableList(Unknown Source)
at org.opensourcephysics.display.DrawingPanel.paintEverything(Unknown Source)
at org.opensourcephysics.display.DrawingPanel.render(Unknown Source)
at org.opensourcephysics.display.DrawingPanel.render(Unknown Source)
at org.colos.ejs.library.control.swing.ControlDrawablesParent.finalUpdate(Unknown Source)
at org.colos.ejs.library.control.EjsControl.finalUpdate(Unknown Source)
at org.colos.ejs.library.Animation.update(Unknown Source)
at org.colos.ejs.library.Animation.updateWhenIdle(Unknown Source)
at org.colos.ejs.library.control.EjsControl.updateSimulationWhenIdle(Unknown Source)
at org.colos.ejs.library.control.ControlElement.variablesChanged(Unknown Source)
at org.colos.ejs.library.control.drawing2d.ControlElement2D.propagatePosition(Unknown Source)
at org.colos.ejs.library.control.drawing2d.ControlElement2D.reportMouseMotion(Unknown Source)
at org.colos.ejs.library.control.drawing2d.ControlElement2D.interactionPerformed(Unknown Source)
at org.opensourcephysics.drawing2d.Element.invokeActions(Unknown Source)
at org.colos.ejs.library.control.swing.UpdateHotSpot2DDelayedAction.performAction(Unknown Source)
at org.colos.ejs.library.Animation.checkMethodsInvokedByView(Unknown Source)
at org.colos.ejs.library.Animation.update(Unknown Source)
at org.colos.ejs.library.Animation.step(Unknown Source)
at org.colos.ejs.library.Animation.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)