|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Font
public class Font
A class that produces font objects.
| Field Summary | |
|---|---|
static int |
BOLD
The bold style constant. |
static int |
ITALIC
The italicized style constant. |
protected String |
name
The logical name of this font. |
static int |
PLAIN
The plain style constant. |
protected int |
size
The point size of this font. |
protected int |
style
The style of the font. |
| Constructor Summary | |
|---|---|
Font(String name,
int style,
int size)
Creates a new font with the specified name, style and point size. |
|
| Method Summary | |
|---|---|
static Font |
decode(String str)
Gets the specified font using the name passed in. |
boolean |
equals(Object obj)
Compares this object to the specifed object. |
String |
getFamily()
Gets the platform specific family name of the font. |
static Font |
getFont(String nm)
Gets a font from the system properties list. |
static Font |
getFont(String nm,
Font font)
Gets the specified font from the system properties list. |
String |
getName()
Gets the logical name of the font. |
int |
getSize()
Gets the point size of the font. |
int |
getStyle()
Gets the style of the font. |
int |
hashCode()
Returns a hashcode for this font. |
boolean |
isBold()
Indicates whether the font's style is bold. |
boolean |
isItalic()
Indicates whether the font's style is italic. |
boolean |
isPlain()
Indicates whether the font's style is plain. |
String |
toString()
Converts this object to a String representation. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
protected String name
protected int style
PLAIN, BOLD,
or ITALIC.
protected int size
| Constructor Detail |
|---|
public Font(String name,
int style,
int size)
name - the font namestyle - the constant style usedsize - the point size of the fontToolkit.getFontList()| Method Detail |
|---|
public String getFamily()
getName method to get the logical name of the font.
getName()public String getName()
getFamily()public int getStyle()
isPlain(),
isBold(),
isItalic()public int getSize()
public boolean isPlain()
true if the font is neither
bold nor italic; false otherwise.getStyle()public boolean isBold()
true if the font is bold;
false otherwise.getStyle()public boolean isItalic()
true if the font is italic;
false otherwise.getStyle()public static Font getFont(String nm)
nm - the property namegetFont(java.lang.String, java.awt.Font)public static Font decode(String str)
str - the name
public static Font getFont(String nm,
Font font)
System.getProperty.
The string value of this property is then interpreted as a font.
The property value should be one of the following forms:
"BOLD", "BOLDITALIC", or
"ITALIC", and point size is a decimal
representation of the point size.
The default style is PLAIN. The default point size
is 12.
If the specified property is not found, the font
argument is returned instead.
nm - the property namefont - a default font to return if property nm
is not defined
Font value of the property.public int hashCode()
hashCode in class ObjectObject.equals(java.lang.Object),
Hashtablepublic boolean equals(Object obj)
true if and only if the argument is not
null and is a Font object with the same
name, style, and point size as this font.
equals in class Objectobj - the object to compare this font with.
true if the objects are equal;
false otherwise.Object.hashCode(),
Hashtablepublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||