Early Abacus program error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
<p>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: </p>

<pre><code>myAbacus.addCounter(thisCol);
</code></pre>

<p>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.</p>

<p><a href="http://pastebin.com/9Bc9NViP" rel="nofollow">AbacusPanel.java</a></p>

<p><a href="http://pastebin.com/ye40aRMD" rel="nofollow">AbacusModel.java</a></p>
