Randall Twede wrote:i had the opposite question. window resize based on image size. but i will save it for another post.
Since the answer is brief, I'll provide it here (sorry Yohan!). In the (J)component that paints the image, override getPreferredSize to return the size of the image. Then call pack() on the window it's shown in.
There are no new questions, but there may be new answers.