If you have a background image in a frame (depending on the method you use to display it), image dimensions may not be taken into account while packing the frame. Override getPreferredSize() to return the image dimension. This should give correct packing dimensions.
Since Java 1.5, this can be done without overriding, just by calling frame.setPreferredSize(dimension), where dimension is a Dimension, and frame is any component (but in this case probably a JFrame).
See also Pack Frames,Background Image.