title: Grid being draw off screen
body: <p>I am having a bit of trouble making this grid be drawn 10 pixels from the top and 10 pixels from the left of the Frame.</p>
  
  <p>I can make it do it by increasing this.getY() + 10 to a higher number, just wondering why if is remove the + 10 it getting drawn off screen.</p>
  
  <p>Ignore the variable names and any formatting I just threw this together</p>
  
  <pre><code>package griddrawing;
  
  import java.awt.*;
  import javax.swing.*;
  
  public class Grid extends JFrame
  {
  
      private int TILEWIDTH;
      private int TILEHEIGHT;
      private int COLS;
      private int ROWS;
      private int defaultX;
      private int defaultY;
      private int currentX;
      private int currentY;
  
      public Grid()
      {
          setSize(800,400);
          TILEWIDTH = 30;
          TILEHEIGHT = 30;
          COLS = 10;
          ROWS = 10;
          defaultX = this.getX() + 10;
          defaultY = this.getY() + 10;
          currentX = 0;
          currentY = 0;
      }
  
      @Override
      public void paint(Graphics g)
      {
          super.paint(g);
  
          currentX = defaultX;
          currentY = defaultY;
  
          g.setColor(Color.black);
  
          for(int i = 0; i &lt; COLS; i++)
          {
              for(int k = 0 ; k &lt; ROWS; k++)
              {
                  g.drawRect(currentX - (TILEWIDTH / 2), currentY - (TILEHEIGHT / 2), TILEWIDTH, TILEHEIGHT);
                  g.drawString("" + k, currentX, currentY);
                  currentY += TILEWIDTH;
                  System.out.println("COL: " + i + " ROW: " + k + " Current X: " + currentX + " Current Y: " + currentY);
              }
              currentY = defaultY;
              currentX += TILEHEIGHT;
          }
      }
  }
  </code></pre>