KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > FontUIResource


1 /*
2  * @(#)FontUIResource.java 1.15 05/11/02
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.plaf;
9
10 import java.awt.Font JavaDoc;
11 import javax.swing.plaf.UIResource JavaDoc;
12
13 import sun.font.FontManager;
14
15 /**
16  * A subclass of java.awt.Font that implements UIResource.
17  * UI classes which set default font properties should use
18  * this class.
19  * <p>
20  * <strong>Warning:</strong>
21  * Serialized objects of this class will not be compatible with
22  * future Swing releases. The current serialization support is
23  * appropriate for short term storage or RMI between applications running
24  * the same version of Swing. As of 1.4, support for long term storage
25  * of all JavaBeans<sup><font size="-2">TM</font></sup>
26  * has been added to the <code>java.beans</code> package.
27  * Please see {@link java.beans.XMLEncoder}.
28  *
29  * @see javax.swing.plaf.UIResource
30  * @version 1.15 11/02/05
31  * @author Hans Muller
32  *
33  */

34 public class FontUIResource extends Font JavaDoc implements UIResource JavaDoc
35 {
36     public FontUIResource(String JavaDoc name, int style, int size) {
37     super(name, style, size);
38     }
39     
40     public FontUIResource(Font JavaDoc font) {
41     super(font.getName(), font.getStyle(), font.getSize());
42         FontManager.setSameHandle(font, this);
43     }
44 }
45
Popular Tags