title: Graphical artifact with BorderFactory in paintComponent
body: <p>I have some code for a Scrabble Game I am writing (actually rewriting), and it is split up into 3 classes so far. The <code>Tile</code> class seems to be generating a BorderFactory artifact when it is put in the window. Why is this artifact appearing, and how can I eliminate it? </p>
  
  <p>*If you don't see the artifact, try resizing the window slowly.</p>
  
  <p>Here is the <code>Scrabble</code> class.</p>
  
  <pre><code>import javax.swing.JFrame;
  import java.awt.BorderLayout;
  public class Scrabble extends JFrame implements Runnable
  {
    public Board board;
    public Scrabble()
    {
      super("Scrabble!");
      board = new Board();
      addBorderLayoutObjects();
    }
    public void run()
    {
      makeSettings();
      setVisible(true);
    }
    public void makeSettings()
    {
      setSize(850, 900);
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      //this.setResizable(false);
    }
    public void addBorderLayoutObjects()
    {
      getContentPane().add(BorderLayout.CENTER, board);
    }
    public static void main(String[] args)
    {
      Scrabble s = new Scrabble();
      javax.swing.SwingUtilities.invokeLater(s);
    }
  }
  </code></pre>
  
  <p>Here is the <code>Board</code> class.</p>
  
  <pre><code>import javax.swing.JPanel;
  import java.awt.Point;
  import java.awt.Color;
  import java.awt.GridLayout;
  public class Board extends JPanel
  {
    public Tile [][] board;
    public Board()
    {
      super(new GridLayout(15, 15));
      board = new Tile[15][15];
      makeBoard();
    }
    public void makeBoard()
    {
      for(int k = 0; k &lt; 225; k++)
      {
        board[k/15][k%15] = new Tile(new Color(0xCBC4A8), Color.BLACK);
      }
      for(int a = 0; a &lt; 15; a++)
        {
          for(int l = 0; l &lt; 15; l++)
          {
            add(board[a][l]);
          }
        }
    }
  }
  </code></pre>
  
  <p>And the <code>Tile</code> class.</p>
  
  <pre><code>import javax.swing.JPanel;
  import javax.swing.BorderFactory;
  import java.awt.Point;
  import java.awt.Color;
  import java.awt.Graphics;
  import java.awt.event.MouseListener;
  import java.awt.event.MouseEvent;
  public class Tile extends JPanel implements MouseListener
  {
    private Color color;
    private Color border;
    public Tile(Color _color, Color _border)
    {
      color = _color;
      border = _border;
    }
    public void mouseEntered(MouseEvent e){}
    public void mouseExited(MouseEvent e){}
    public void mousePressed(MouseEvent e){}
    public void mouseReleased(MouseEvent e){}
    public void mouseClicked(MouseEvent e){}
    @Override
    public void paintComponent(Graphics g)
    {
      g.setColor(color);
      setBorder(BorderFactory.createLineBorder(border, 2));
    }
  }
  </code></pre>