Early Abacus program error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
07:14 26 Mar 2012

I am attempting to create a simple abacus for a beginner's programming course, and have come across an error that I simply can not get my head around. I've hunted around Google but so far no success. The program will compile in Textpad absolutely fine, and at first it will run fine, displaying the grid and being able to understand what column the mouse is in. However, left clicking to run the addCounter method results in a "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException" error. It directs me to line 50 of AbacusPanel.java which is:

myAbacus.addCounter(thisCol);

I cannot for the life of me work out what I am doing wrong here, so any help would be really appreciated. I hope Pastebin links are okay.

AbacusPanel.java

AbacusModel.java

java