JButton html text not displayed after page refresh in Java applet
I am displaying some multiline text in a JButton within a Java applet using html tags.
When the web page containing the java applet is displayed for the first time the html text is rendered correctly. If the web page is refreshed, the JButton is shown with no text.
Debugging the applet, as it is running in the web page, shows that the html text is being applied correctly to the JButton开发者_JAVA技巧.
Non-html text in the JButton is always displayed correctly.
Adding a revalidate() and repaint() call to the JButton just after creation causes the JButton to be displayed with no text every time (not just after a web-page refresh).
This effect is seen in Google Chrome, Firefox and Internet Explorer.
Modifying the content of the html text by appending a random number each time it is rendered make no difference.
How can I get the html content of the JButton to be displayed every time the page is refreshed?
See bug 6993691 for details & a workaround. Strangely, that bug is closed as a duplicate of another bug which is no longer available on the DB.
精彩评论