Your posted code uses the getScaledImage() method.
I think you must be confusing my code with another you are helping. I don't use that method.
That is not what was suggested. You need to override the getPreferredSize() method to return the size of the image that you want to paint on the panel.
Again I think you must be confusing my code with another you are helping. You never made that suggestion concerning this
thread.
Also I'm not always dealing with a single image, sometimes their maybe none others it could be as many as 15 - 20 or more.
But thanks for the effort.