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

HTML support for components throws exception on unknown HTML tag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 1.3.0
    • 1.2.0, 1.2.2
    • client-libs
    • None
    • beta
    • unknown, x86
    • solaris_2.5.1, solaris_7

    Description

      If you use HTML to create a label or button,
      and if you include an invalid HTML tag (such as <bold>) in the HTML,
      the program throws a ClassCastException.

      It'd be nice if instead, the program printed an error message
      and indicated what tag was in error.

      Here's a sample trace:
       > > java.lang.ClassCastException: javax.swing.JLabel
      > > at javax.swing.text.html.EditableView.setParent(EditableView.java:95)
      > > at javax.swing.text.ParagraphView.loadChildren(ParagraphView.java:130)
      > > at javax.swing.text.CompositeView.setParent(CompositeView.java:360)
      > > at javax.swing.text.html.ParagraphView.setParent(ParagraphView.java:67)
      > > at javax.swing.text.CompositeView.replace(CompositeView.java:185)
      > > at javax.swing.text.BoxView.replace(BoxView.java:101)
      > > at javax.swing.text.CompositeView.loadChildren(CompositeView.java:99)
      > > at javax.swing.text.CompositeView.setParent(CompositeView.java:360)
      > > at javax.swing.text.CompositeView.replace(CompositeView.java:185)
      > > at javax.swing.text.BoxView.replace(BoxView.java:101)
      > > at javax.swing.text.CompositeView.loadChildren(CompositeView.java:99)
      > > at javax.swing.text.CompositeView.setParent(CompositeView.java:360)
      > > at javax.swing.plaf.basic.BasicHTML$Renderer.<init>(BasicHTML.java:186)
      > > at javax.swing.plaf.basic.BasicHTML.createHTMLView(BasicHTML.java:48)
      > > at javax.swing.plaf.basic.BasicHTML.updateRenderer(BasicHTML.java:77)
      > > at javax.swing.plaf.basic.BasicLabelUI.propertyChange(BasicLabelUI.java:355)
      > > at
      > > javax.swing.event.SwingPropertyChangeSupport.firePropertyChange(SwingPropertyChangeSupport.java:154)
      > > at javax.swing.JComponent.firePropertyChange(JComponent.java:2990)
      > > at javax.swing.JLabel.setText(JLabel.java:287)
      > >

      Attachments

        Issue Links

          Activity

            People

              svioletsunw Scott Violet (Inactive)
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: