News

To display HTML in a JEditorPane, ... The createImage(src) function can return before all the image’s pixels have been populated. If that happens, a broken image will be displayed.
The image probably isn't loaded by that time. I mean, it's probably a couple milliseconds, if that, between when you assign that src and when you ask for the width and height.