Isn't this one of those situations? No components are being added to a visible container, only an Icon being set. If I run the above example no resizing occurs unless both setPreferredSize and...
Type: Posts; User: copeg
Isn't this one of those situations? No components are being added to a visible container, only an Icon being set. If I run the above example no resizing occurs unless both setPreferredSize and...
Cool. The first thing at least with this code, is that you are adding the panel to the frame instead of the JScrollPane. Next, if I run the code setting the preferredsize as follows, it works for me:...
Did the preferredSize change? Can you post a small portion of code that reproduces the issue?
When you add the image to the JPanel (or component within), first set the preferredSize of the JPanel (or component within) so that it incorporates the full size of the image (or whichever dimensions...