Can anybody explain why pack() isn’t working on this JFrame?
It’s got one JPanel inside (actually, a class that extends JPanel – inner).
Here’s the code I’m using:
inner.setPreferredSize(new Dimension(800, 600));
add(inner);
pack();
setResizable(false);
setLocationRelativeTo(null); // to center the JFrame on screen
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
The extra space seems to be the exact width and height of the JFrame’s decoration (that is, the JFrame’s dimensions minus the JPanel’s dimensions).

Turns out I was drawing (active rendering) from the JFrame and not the JPanel… so the extra space was the result of the JPanel’s draw() object being aligned at 0,0 (in the JFrame).
Solved by this post.