title: Java paint particular objects
body: <p>I am writing a game in Java which is based on a grid top down view. I am not very familiar with the JPanel paintComponent() and repaint() methods and I am having trouble creating a fast screen painting function.
  Each tile is an object with a Tile.paintTile(g,x,y) to paint the tile at (x,y) on g. I want to find a nice way to paint only specific tiles, however I cannot find out how to do this. 
  I have a World class with a TileAt(x,y) to get the tile, but every attempt I have made has caused stuttering or thrown errors.
  Any help is appreciated!
  -Renmusxd</p>
  
  <p>edit: what I tried:
  I am not very used to Java graphics yet, I tried overwriting paintComponent and adding paintComponent(g,x,y) but it doesn't like my not calling repaint. I no longer have the code because I substituted it with a paintAll version. Sorry.</p>