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

HTML <SUPER> tag in JLabel causes ClassCastException.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.2.2
    • client-libs

    Description



      Name: krT82822 Date: 06/11/99


      orign synopsis: "HTML within JLabel causes exception."

      % java version
      java version "1.2.2"
      Classic VM (build JDK-1.2.2-U, green threads, sunwjit)
      % java -fullversion
      java full version "JDK-1.2.2-U"

      Swing 1.1.1b2

      If a JLabel text is set to HTML that contains <super> tag,
      an exception occurs within Swing:

      Exception occurred during event dispatching:
      java.lang.ClassCastException: javax.swing.JLabel
              at javax.swing.text.html.EditableView.setParent(EditableView.java, Compiled Code)
              at javax.swing.text.ParagraphView.loadChildren(ParagraphView.java, Compiled Code)
              at javax.swing.text.CompositeView.setParent(CompositeView.java, Compiled Code)
              ...

      Here is a test case:

      import javax.swing.JFrame;
      import javax.swing.JLabel;
      import java.awt.Container;

      class Test {
          public static void main(String args[]){
              JFrame f = new JFrame();
              Container pane = f.getContentPane();
              JLabel label = new JLabel(
                      "<html>Hello<super>tm</super>");
              pane.add(label);
              f.pack();
              f.show();
              }
          }
      (Review ID: 84229)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              svioletsunw Scott Violet (Inactive)
              kryansunw Kevin Ryan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: