Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML no longer working in JLabel (and other components)
    primarykey
    data
    text
    <p>I have a java applet that I've written and have been running it for quite a while. In the applet I have a bunch of JLabels that use HTML in their text content (which is allowed, and has been working for years). The main reason I use HTML is to allow line breaks in JLabels.</p> <p><strong>The issue:</strong> fairly recently the JLabels that have HTML in them (some don't) stopped displaying their text. I think it might have something to do with the recent java update (Java SE 6 Update 22, on 2010-Oct-12) not 100 percent sure, but the problems did seem to start around then. Maybe a bug has been introduced? or feature removed?</p> <p>I tried with a JEditorPane and seemed to have the same issues when the content was HTML.</p> <p>Also something important to note is that the first time you load the applet (first time your java runtime starts) it works FINE, but if you refresh the webpage then it has the issues as described.</p> <p>Does anyone have similar issues? anyone have any insights? or am I just doing something dumb?</p> <p>I made a very simple test applet and I can reproduce the issues with 100% regularity (remembering that the first time the runtime loads it will work fine, only successive refreshes will cause the issues):</p> <p>[HelloWorldApplet.java]</p> <pre><code>import javax.swing.*; public class HelloWorldApplet extends JApplet { public void init() { this.add(new JLabel("Hello Everybody (Text)"), java.awt.BorderLayout.NORTH); this.add(new JLabel("&lt;html&gt;&lt;body&gt;Hello Everybody (HTML)&lt;/body&gt;&lt;/html&gt;"), java.awt.BorderLayout.SOUTH); } } </code></pre> <p>[HellowWorldApplet.html]</p> <pre><code>&lt;html&gt; &lt;title&gt;A Test&lt;/title&gt; &lt;body&gt; &lt;applet code="HelloWorldApplet.class" width="320" height="120"&gt; You need Java &lt;/applet&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>PS. I've been mainly testing using Chrome but I did breifly try in IE 8 also. Also I (obviously) have the latest Java SE 6 update 22 installed as my run time, and have the matching update for my JDK. I compile the above test applet using simply: "javac HelloWorldApplet.java"</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload