I'm displaying a window as seen in this picture below, which is set to 640 x 640.
As you can see, the squares, which are 32 x 32, do not line up correctly. (20 squares by 20 squares)
I took a crude screenshot and discovered that the dimensions had been reduced by tens of pixels. What's going on here?
Here is my code
package main;
import javax.swing.JFrame;
public class Game extends JFrame {
private GameScreen gameScreen;
public Game() {
setSize(640, 640);
setVisible(true);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setLocationRelativeTo(null);
gameScreen = new GameScreen();
add(gameScreen);
}
public static void main(String[] args) {
Game game = new Game();
}
}