Java Swing (Web hosting company) - O Reilly 23.2.9 The LabelView Class
Java Swing - O Reilly 23.2.9 The LabelView Class This View subclass is used to display a section of text with common attributes. A LabelView [3] is responsible for painting an Element from a StyledDocument. However, as we’ll see later (Figure 23.10), if the view does not fit on a single line, it is actually replaced by multiple LabelView.LabelFragment objects, which are together responsible for painting the single Element. [3] Despite the somewhat misleading name, LabelView has nothing to do with rendering JLabels or even simple text fields. LabelView supports intelligent breaking of views to allow breaks to occur on word boundaries. It implements the TabableView interface, reflecting the fact that the text it represents may contain tabs. In order for tabs to be rendered correctly, LabelViews must be embedded in views that implement TabExpander such as ParagraphView. 23.2.9.1 Properties The LabelView class modifies the implementation of the View properties shown in Table 23.6. See the description of View properties for details on these properties. The Y_AXIS alignment is defined as (height-descent)/height for the current font. In other words, LabelViews are aligned along their baselines (see Figure 23.8). X_AXIS alignment is delegated to the superclass. The X_AXIS preferredSpan is the width of the text to be displayed, computed using Utilities.getTabbedTextWidth(). The Y_AXIS preferredSpan is just the height of the font currently in use. Table 23.6, LabelView Properties Property Data Type get is set bound Default Value alignment (indexed)* float element* Element From constructor preferredSpan (indexed)* float From Icon dimensions See also properties from the View class (Table 23.2). Figure 23.8. LabelView y-axis alignment The element property is set in the constructor. 23.2.9.2 Constructor public LabelView(Element elem) Creates a View for the given Element. 23.2.9.3 TabableView Methods The following methods satisfy the TabableView interface implemented by this class: public float getPartialSpan(int p0, int p1) - 767
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.