JLabel label = new JLabel("<html><body>Hello world</body></html>");
shows nothing.
If I get rid of the tags, it shows plain text (as expected), so the JLabel is definitely being added and shown on the window.
Same for:
JEditorPane jep = new JEditorPane("text/html", "<html><body>Hello world</body></html>");
Any ideas?
I'm using java-6-openjdk with Eclipse. More details:
matt@matt-laptop:~$ java -version
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.5) (6b20-1.9.5-0ubuntu1~10.04.1)
OpenJDK Server VM (build 19.0-b09, mixed mode)
matt@matt-laptop:~$ javac -version
javac 1.6.0_24
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…