title: jButtons doesn't add correctly
body: <p>For better reference I'm doing match3 (candy crush type) game. </p>
  
  <pre><code>public class BoardGraphics extends JPanel {
  public static final int WIDTH = 400;
  public static final int HEIGHT = 400;
  private static final Color COLOR = new Color(0xFF0000); //0xF1E4CB
  
  private final Board board;
  
  public BoardGraphics(Board board){
      this.setBackground( COLOR );
      this.setSize(HEIGHT, WIDTH);
      this.setLayout(new GridLayout(board.getHeight(), board.getWidth(), 0, 0));
      this.board = board;
      setVisible(true);
      drawElements();
  }
      private void drawElements(){
      for (int i = 0; i &lt; 2; i++) {
          for (int j = 0; j &lt; 2; j++) {
              Point p = new Point(i, j);
              //Point p = new Point(1, 2);
  
              ImageIcon icon = null;
              try {
                  BufferedImage img = null;
                  img = ImageIO.read(new File(System.getProperty("user.dir") + "/assets/img/gem_" + board.getElement(p).getTileColor().toString() + ".gif"));
  
                  icon = new ImageIcon(img);
  
                  JButton btn = new JButton(icon);
                  btn.setVisible(true);
                  btn.setOpaque(false);
                  btn.setContentAreaFilled(false);
                  btn.setBorderPainted(false);
                  btn.setSize(50, 50);
                  if (i == 1) {
                      btn.setLocation(100, 100); // &lt;- i did this for testing. with this i see 2 gems
                  }
                  this.add(btn);
  
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
  
          }
      this.revalidate();
      this.repaint();
      }
  }
  </code></pre>
  
  <p>and jFrame code here: </p>
  
  <pre><code>public class GameGraphics extends JFrame {
  private final int WIDTH = 600;
  private final int HEIGHT = 800;
  
  private Game game = new Game();
  
  public GameGraphics() {
      setTitle("SwitchElements");
      setDefaultCloseOperation(EXIT_ON_CLOSE);
      setSize(HEIGHT, WIDTH);
      setLocationRelativeTo(null);
      setVisible(true);
      setResizable(false);
  
      drawBoard();
  }
  
  private void drawBoard(){
      // 0xF1E4CB
      BoardGraphics board = new BoardGraphics(game.getGameBoard());
      System.out.println((WIDTH-BoardGraphics.WIDTH)/2);
      board.setLocation( (HEIGHT-BoardGraphics.HEIGHT)/2, (WIDTH-BoardGraphics.WIDTH)/2);
  
      this.add( board );
  
      this.repaint();
  }
  }
  </code></pre>
  
  <p>the thing is that I tried everything. But jButtons doesn't stack according to grid.
  it seems that all of them adds into one place</p>