i move the compass non-stop up and down across the picture of the magnet.

it is not exactly a reproducible error and i can't pin point where it happens, but it has happened to me on different machines Mac and PC.

and yes you are right, the error is also found in my modified version, that is why i went back to the http://www.compadre.org/OSP/items/detail.cfm?ID=9414 version and drag the compass like mad, and true enough, it happens too.

i also checked with wolfgang he  said "The model does not change the array size and appears to be an EJS drawing problem."
i also checking with paco :)

i just tried again on a Mac
the error is:
Exception in thread "Thread-2" java.lang.ArrayIndexOutOfBoundsException: 20
at org.opensourcephysics.drawing2d.VectorField.processMagnitude(Unknown Source)
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.run(Unknown Source)
at java.lang.Thread.run(Thread.java:637)

seems slightly different error message from the windows 7

i attached the picture of the line 637 [img]http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1576.0;attach=2142;image[/img] of the file MagneticBarFieldView.java  and the file itself.

never mind if it cannot be solved, i think the applet is more stable after the reset button is clicked once, i try to add the reset code to it and see how.