0

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.

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?

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Adding new ParserDelegator() fixes the problem (thank you), although I'm still slightly confused because I'm not seeing any exceptions in the Java console. I guess this is because that bug is fixed, but the html something-or-other is still cached?
To be honest, I can provide no further information. I mean I could make some up, but.. ;) Glad you got it sorted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.