In Picture 1, at lines 103 and 104, when the JFrame first starts to become visible, and then disable resizing, it causes a bug in JFrame.pack() method and display an inaccurate size of the JFrame's border size.
However, in Picture 2, when lines 103 and 104 are switched around, everything is correctly displayed.
So, what should I do about this? Should I report this or just leave it, as I have fixed it by using the solution in Picture 2? Thanks for viewing.
JFrame uses whatever default layout manager is, which may interpret dimensions differently.
Either set a layout manager or just set Game as contentPane.
Layout managers are a pain.
Should I report this or just leave it
Aside from likely not being a bug, Swing was abandoned years ago, only thing still on life support is JavaFX and neither Sun nor Oracle cared about Swing foundation, so IMHO it's not worth reporting it.
Absolute sizes are next to impossible to implement correctly. For example, they need to take into account dpi setting of the screen, something which is buggy in just about every OS. There's also problems with aspect ratio. All of these become an issue once fonts are involved.
Swing also abstracts away the crucial API each OS uses to provide such information, but the abstractions aren't enough.
Unless you want to spend most of development trying to tweak around all kinds of inconsistencies, just design UI to be dynamic.
Or make it fixed size, but center it on screen (BorderLayout.CENTER or similar). Trying to match it to outer borders of JFrame is simply not worth it.