title: How to debug code for reset functionality in Java GUI application?
body: <p>I am writing some simulation code and managed to get my model running as expected. However when I reset the model (it sits on top of a large amount of code written by others that i don't have access to right now) and want to rerun it I run into trouble.</p>
  
  <p>From what I have gathered from reading posts on the site and errors i receive problems occur because of null pointer exceptions and Awt-queue errors because of some of the graphical elements running into trouble after the reset (because of those items they relate to are no longer valid).</p>
  
  <p>0- What generally happens when the reset button is pressed in a simulation code? I guess (hope) everyone else has done their homework right and since i am ignorant about this i need to do some clean up of my own to make everything act nice.  </p>
  
  <p>1-Now what is the easiest way to fix these sort of problems that only happen after when rerunning code?</p>
  
  <p>2-Also what are general guidelines for clean up of code after each run of a simulation? </p>