I just added g.drawRect to your paint method, I think it's obvious why it's not working if you try this code
Code:@Override public void paint(final Graphics g) { int xt = 0; int row; int col; int x, y; for (row = 0; row < IMAGES; row++) for (col = 0; col < IMAGES; col++) { x = col * IMAGES; y = row * IMAGES; // if((row % 1) == (col % 1)) // g.drawImage(cards[col][col], xt, 0, this); g.drawRect(x, y, 100, 100); xt += cards[row][row].getWidth(null) + 10; xt += cards[col][col].getHeight(null) + 10; // cards[i][i] = (int) (Math.random()*5); // if((row % 2) == (col % 2)) // g.drawImage(cards[col][col], xt, 0, this); // xt+=cards[col][col].getWidth(null) + 10; } }




Reply With Quote