Java Swing - O Reilly Removes the named Style (Web page design)

Java Swing - O Reilly Removes the named Style from the context. 21.1.5.8 Font Management Methods These methods are used to manage Font objects. An Element’s Font is not typically stored as a single attribute, so it’s nice to have an easy way to obtain the Font and ensure that duplicate Font objects aren’t created unnecessarily. public Font getFont(AttributeSet attr) Checks for four attributes (Bold, Italic, FontFamily, and FontSize) in the given set, based on the constants defined in the StyleConstants class. From the values of these attributes, it returns a Font using the getFont() method. public Font getFont(String family, int style, int size) Searches an internal table for a Font matching the given font family, style, and size. If the Font is found, it is returned. If not, a new Font object is created, added to the table, and returned. The second parameter should be a logical “or” of the constants Font.PLAIN, Font.BOLD, and Font.ITALIC that defines the desired attributes. public FontMetrics getFontMetrics(Font f) Returns the FontMetrics object for the given Font using the default Toolkit. This method simply calls getFontMetrics() on the default Toolkit. 21.1.5.9 Color Accessor Methods public Color getForeground(AttributeSet attr) public Color getBackground(AttributeSet attr) Call StyleConstants.getForeground(attr) and StyleConstants.get- Background(attr). They could be overridden to take other attributes (brighter, darker, etc.) into account. 21.1.5.10 Serialization Methods The following static methods define a mechanism for reading and writing an AttributeSet to a stream. They are written so that the constant attribute keys defined in StyleConstants will be recognized when the stream is read, allowing references to the existing static objects to be used, instead of creating new ones. If these methods were not used, whenever a serialized AttributeSet was read in, new instances of the constants including StyleConstants.Bold, StyleConstants.Foreground, etc. were created. Each set would have its own “bold” attribute, rather than the shared StyleConstants.Boldinstance. These methods prevent this from happening by giving special treatment to registered attribute keys. public static void registerStaticAttributeKey(Object key) - 710
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

Leave a Reply