after the if/else
so it will apply in both case (when you add(label) or you add(img)
Worst case put a println() in the paint() method of ImageLabel to see that it is effectively called and print the getWidth() and getHeight()
You can also ImageLabel constructor to receive the ImageIcon as parameter instead of the file name as you already have the Icon.
Don't see why it shouldn't work
This post has been edited by pbl: 09 May 2012 - 08:42 AM