Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6688690

CDATA HTML not rendered in JLabel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • 6, 6u10
    • client-libs
    • x86
    • linux, windows_xp

      FULL PRODUCT VERSION :
      java version "1.6.0_04"
      Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
      Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP

      A DESCRIPTION OF THE PROBLEM :
      Testcase shows 2 problems when rendering html in JLabel:
      - CDATA element is not rendered
      - "/" is also not rendered

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      [code]
      package test;

      import java.awt.*;

      import javax.swing.*;

      public class Main extends JFrame {


      public Main(String title) throws HeadlessException {
      super(title);
      setLayout(new BorderLayout());
      JPanel panel = new JPanel();
      panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
      JLabel label = new JLabel("<html><![CDATA[This doesn't render]]></html>");
      JLabel label2 = new JLabel("<html>/</html>");;
      panel.add(label);
      panel.add(label2);
      add(panel, BorderLayout.CENTER);
      }

      public static void main(String[] args) {
      Main main = new Main("HTML test");
      main.setSize(new Dimension(500, 500));
      main.pack();
      main.setVisible(true);

      }

      }

      [/code]

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Labels should render "This doesn't render" and "/"
      ACTUAL -
      Nothing is displayed

      REPRODUCIBILITY :
      This bug can be reproduced always.

            peterz Peter Zhelezniakov
            igor Igor Nekrestyanov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: