title: How can I best apply OOP principles to games and other input-driven GUI apps?
body: <p>Whenever I try to write graphical programs (whether a game or really any GUI app) I always wind up with one or two god classes with way too many methods (and long methods, too), and each class having far too many responsibilities. I have graphics being done at the same time as calculations and logic, and I feel like this is a really bad way to go about organizing my code. I want to get better at organizing my code and abstracting out responsibilities to different classes. Here's an example of where I'd like to start - I want to write a Minesweeper clone, just sort of as practice and to try to improve my software engineering skills. How would I go about making this nice and object-oriented? For the sake of discussion, let's just say I'm using Java (because I probably will, either that or C#). Here's some things I would think about:</p>
  
  <ul>
  <li>should each tile inherit from JButton or JComponent and handle drawing itself? </li>
  <li>or should the tiles just be stored as some non-graphical MinesweeperTile object and some other class handles drawing them?</li>
  <li>is the 8-segment display countdown timer (pre-Vista, at least) a separate class that handles drawing itself?</li>
  <li>when the user clicks, do the tiles have mouse event listeners or does some other collision detection method loop through the tiles and check each one to see if it's been hit?</li>
  </ul>
  
  <p>I realize that there's not just one way to write a GUI application, but what are some pretty basic things I can start doing to make my code more organized, manageable, object-oriented, and just over all write better programs?</p>
  
  <hr>
  
  <p>edit: I guess I should add that I'm familiar with MVC, and I was originally going to incorporate that into my question, but I guess I didn't want to shoehorn myself into MVC if that's not necessarily what I need. I did searched for topics on MVC with GUI apps but didn't really find anything that answers my specific question. </p>
  
  <hr>
  
  <p>edit2: Thanks to everyone who answered. I wish I could accept more than one answer..</p>