Check are u intializing each drawObjects before you use it
drawObjects[i] = new Shapes(); // Are u doing like this.........................
Majestics
Practically a Master Poster
696 posts since Jul 2007
Reputation Points: 209
Solved Threads: 66
Skill Endorsements: 5
Your array of Shapes starts out containing 20 nulls which get replaced by Shapes when you add a new Shape. It looks like the var count contains the number of Shapes currently in the array, so that it what you need for the upper limit of your for loop - ie stop the loop before it goes into the null part of the array.
I can't see the code where you add a new Shape - shouldn't that be in the ButtonListener ?
What's the point of all the parameters on the constructor on line 21? You don't use any of them!
JamesCherrill
... trying to help
8,519 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30
Question Answered as of 1 Year Ago by
Majestics
and
JamesCherrill