Java™ Platform
Standard Ed. 8
javax.swing.text.html

Class ObjectView

  • All Implemented Interfaces:
    SwingConstants


    public class ObjectView
    extends ComponentView
    Component decorator that implements the view interface for <object> elements.

    This view will try to load the class specified by the classid attribute. If possible, the Classloader used to load the associated Document is used. This would typically be the same as the ClassLoader used to load the EditorKit. If the document's ClassLoader is null, Class.forName is used.

    If the class can successfully be loaded, an attempt will be made to create an instance of it by calling Class.newInstance. An attempt will be made to narrow the instance to type java.awt.Component to display the object.

    This view can also manage a set of parameters with limitations. The parameters to the <object> element are expected to be present on the associated elements attribute set as simple strings. Each bean property will be queried as a key on the AttributeSet, with the expectation that a non-null value (of type String) will be present if there was a parameter specification for the property. Reflection is used to set the parameter. Currently, this is limited to a very simple single parameter of type String.

    A simple example HTML invocation is:

          <object classid="javax.swing.JLabel">
          <param name="text" value="sample text">
          </object>
     
    • Constructor Detail

      • ObjectView

        public ObjectView(Element elem)
        Creates a new ObjectView object.
        Parameters:
        elem - the element to decorate
    • Method Detail

      • createComponent

        protected Component createComponent()
        Create the component. The classid is used as a specification of the classname, which we try to load.
        Overrides:
        createComponent in class ComponentView
Java™ Platform
Standard Ed. 8

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

微信小程序

微信扫一扫体验

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部