Matthew Brown wrote:Looks like it's something to do with the repainting. If you resize the window (after getting rid of the line that prevents it!) the buttons appear immediately. So maybe the HTML tags change the way the repainting is carried out.
There is one dead-easy fix, though. Move the statement myFrame.setVisible(true) to the end.
(Technically, you should probably be doing all this in the Event Dispatch thread)
Weird, I had actually already tried calling a myFrame.repaint() to see if that fixed it. And in my small demo posted here, it looks like frame repaint DOES fix it. But in my larger more complex program, it does NOT! However, doing like you said and setting visible at the end does seem to work in my complex program, but this whole thing is so screwy it has just turned me off to HTML in the buttons I think, I don't trust it now.
Also, your post is the first mention I've ever heard of an "Event Dispatch thread." I guess I will have to look into that.