I am working on this game in Java, and I just rewrote all my window related code from being based on java.awt to javax.swing. Soon after, I realized that things were a bit m
This is an issue related to using setResizable(false);
AFTER you've tried setting the size of the window.
The problem is that (on Windows at least), the size of the frames border is different between resizable and non-resizable windows.
Call setResizable
before calling pack
If you want a better (and generally more reliable) way to center your window, consider using
setLocationRelativeTo(null);
instead of
setLocation(s.width/2-getWidth()/2, s.height/2-getHeight()/2);
Toolkit.getScreenSize
doesn't take into consideration the space taken up by the task bar...