title: How do you structure a java program?
body: <p>For quite awhile I have been trying to make a simple "game" in Java that is really just an applet with a square and a grid. What I want it to do in the end is the user clicks and the square will move to where the user clicked rounded to the nearest grid square. </p>
  
  <p>The problem is I am a self taught beginner and I am having a hard time figuring out how to actually structure the program, some examples: </p>
  
  <ul>
  <li>should I have a separate class listening for mouse clicks?</li>
  <li>When I receive a click should I send it to some other object that represents the box and let it decide what it wants to do or just call some function that makes the box move?</li>
  </ul>
  
  <p>I really want to learn all this "when to use what" stuff for myself so any links or general advice is appreciated.</p>