| Package | Description | 
|---|---|
| java.awt | Contains all of the classes for creating user
interfaces and for painting graphics and images. | 
| java.awt.font | Provides classes and interface relating to fonts. | 
| javax.accessibility | Defines a contract between user-interface components and an assistive technology
that provides access to those components. | 
| javax.swing | Provides a set of "lightweight"
(all-Java language) components that,
to the maximum degree possible, work the same on all platforms. | 
| javax.swing.border | Provides classes and interface for drawing
specialized borders around a Swing component. | 
| javax.swing.plaf | Provides one interface and many abstract classes that
Swing uses to provide its pluggable look-and-feel capabilities. | 
| javax.swing.plaf.basic | Provides user interface objects built according to the
Basic look and feel. | 
| javax.swing.plaf.nimbus | Provides user interface objects built according to the cross-platform
Nimbus look and feel. | 
| javax.swing.plaf.synth | 
      Synth is a skinnable look and feel in which all painting is
      delegated. | 
| javax.swing.table | Provides classes and interfaces for dealing with
 javax.swing.JTable. | 
| javax.swing.text | Provides classes and interfaces that deal with editable
and noneditable text components. | 
| javax.swing.text.html | Provides the class  HTMLEditorKitand supporting classes
for creating HTML text editors. | 
| javax.swing.tree | Provides classes and interfaces for dealing with
 javax.swing.JTree. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected Font | FontMetrics. fontThe actual  Fontfrom which the font metrics are
 created. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Font | Font. createFont(int fontFormat,
          File fontFile)Returns a new  Fontusing the specified font type
 and the specified font file. | 
| static Font | Font. createFont(int fontFormat,
          InputStream fontStream)Returns a new  Fontusing the specified font type
 and input data. | 
| static Font | Font. decode(String str)Returns the  Fontthat thestrargument describes. | 
| Font | Font. deriveFont(AffineTransform trans)Creates a new  Fontobject by replicating the currentFontobject and applying a new transform to it. | 
| Font | Font. deriveFont(float size)Creates a new  Fontobject by replicating the currentFontobject and applying a new size to it. | 
| Font | Font. deriveFont(int style)Creates a new  Fontobject by replicating the currentFontobject and applying a new style to it. | 
| Font | Font. deriveFont(int style,
          AffineTransform trans)Creates a new  Fontobject by replicating thisFontobject and applying a new style and transform. | 
| Font | Font. deriveFont(int style,
          float size)Creates a new  Fontobject by replicating thisFontobject and applying a new style and size. | 
| Font | Font. deriveFont(Map<? extends AttributedCharacterIterator.Attribute,?> attributes)Creates a new  Fontobject by replicating the currentFontobject and applying a new set of font attributes
 to it. | 
| abstract Font[] | GraphicsEnvironment. getAllFonts()Returns an array containing a one-point size instance of all fonts
 available in this  GraphicsEnvironment. | 
| Font | MenuContainer. getFont() | 
| Font | Component. getFont()Gets the font of this component. | 
| Font | Component.AccessibleAWTComponent. getFont()Gets the  Fontof this object. | 
| Font | List.AccessibleAWTList.AccessibleAWTListChild. getFont()Get the Font of this object. | 
| Font | MenuComponent. getFont()Gets the font used for this menu component. | 
| Font | MenuComponent.AccessibleAWTMenuComponent. getFont()Gets the  Fontof this object. | 
| abstract Font | Graphics. getFont()Gets the current font. | 
| Font | FontMetrics. getFont()Gets the  Fontdescribed by thisFontMetricsobject. | 
| static Font | Font. getFont(Map<? extends AttributedCharacterIterator.Attribute,?> attributes)Returns a  Fontappropriate to the attributes. | 
| static Font | Font. getFont(String nm)Returns a  Fontobject from the system properties list. | 
| static Font | Font. getFont(String nm,
       Font font)Gets the specified  Fontfrom the system properties
 list. | 
| Modifier and Type | Method and Description | 
|---|---|
| static Font | Font. getFont(String nm,
       Font font)Gets the specified  Fontfrom the system properties
 list. | 
| FontMetrics | Component. getFontMetrics(Font font)Gets the font metrics for the specified font. | 
| FontMetrics | Component.AccessibleAWTComponent. getFontMetrics(Font f)Gets the  FontMetricsof this object. | 
| FontMetrics | List.AccessibleAWTList.AccessibleAWTListChild. getFontMetrics(Font f)Get the FontMetrics of this object. | 
| FontMetrics | MenuComponent.AccessibleAWTMenuComponent. getFontMetrics(Font f)Gets the  FontMetricsof this object. | 
| abstract FontMetrics | Graphics. getFontMetrics(Font f)Gets the font metrics for the specified font. | 
| abstract FontMetrics | Toolkit. getFontMetrics(Font font)Deprecated. 
 As of JDK version 1.2, replaced by the  FontmethodgetLineMetrics. | 
| boolean | GraphicsEnvironment. registerFont(Font font)Registers a created  Fontin thisGraphicsEnvironment. | 
| void | Component. setFont(Font f)Sets the font of this component. | 
| void | Component.AccessibleAWTComponent. setFont(Font f)Sets the  Fontof this object. | 
| void | List.AccessibleAWTList.AccessibleAWTListChild. setFont(Font f)Set the Font of this object. | 
| void | MenuComponent. setFont(Font f)Sets the font to be used for this menu component to the specified
 font. | 
| void | MenuComponent.AccessibleAWTMenuComponent. setFont(Font f)Sets the  Fontof this object. | 
| abstract void | Graphics. setFont(Font font)Sets this graphics context's font to the specified font. | 
| void | Container. setFont(Font f)Sets the font of this container. | 
| Constructor and Description | 
|---|
| Font(Font font)Creates a new  Fontfrom the specifiedfont. | 
| FontMetrics(Font font)Creates a new  FontMetricsobject for finding out
 height and width information about the specifiedFontand specific character glyphs in thatFont. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | MultipleMaster. deriveMMFont(float[] axes)Creates a new instance of a multiple master font based on the design
 axis values contained in the specified array. | 
| Font | MultipleMaster. deriveMMFont(float[] glyphWidths,
            float avgStemWidth,
            float typicalCapHeight,
            float typicalXHeight,
            float italicAngle)Creates a new instance of a multiple master font based on detailed metric
 information. | 
| abstract Font | GlyphVector. getFont()Returns the  Fontassociated with thisGlyphVector. | 
| Constructor and Description | 
|---|
| TextLayout(String string,
          Font font,
          FontRenderContext frc) | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | AccessibleComponent. getFont()Gets the Font of this object. | 
| Modifier and Type | Method and Description | 
|---|---|
| FontMetrics | AccessibleComponent. getFontMetrics(Font f)Gets the FontMetrics of this object. | 
| void | AccessibleComponent. setFont(Font f)Sets the Font of this object. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | JList.AccessibleJList.AccessibleJListChild. getFont() | 
| Font | DebugGraphics. getFont()Returns the Font used for text drawing operations. | 
| Font | JTable.AccessibleJTable.AccessibleJTableCell. getFont()Gets the  Fontof this object. | 
| Font | JTree.AccessibleJTree.AccessibleJTreeNode. getFont() | 
| Font | UIDefaults. getFont(Object key)If the value of  keyis aFontreturn it,
 otherwise returnnull. | 
| static Font | UIManager. getFont(Object key)Returns a font from the defaults. | 
| Font | UIDefaults. getFont(Object key,
       Locale l)If the value of  keyfor the givenLocaleis aFontreturn it, otherwise returnnull. | 
| static Font | UIManager. getFont(Object key,
       Locale l)Returns a font from the defaults that is appropriate
 for the given locale. | 
| Modifier and Type | Method and Description | 
|---|---|
| static TitledBorder | BorderFactory. createTitledBorder(Border border,
                  String title,
                  int titleJustification,
                  int titlePosition,
                  Font titleFont)Adds a title to an existing border, with the specified
 positioning and font, and using the default text color
 (determined by the current look and feel). | 
| static TitledBorder | BorderFactory. createTitledBorder(Border border,
                  String title,
                  int titleJustification,
                  int titlePosition,
                  Font titleFont,
                  Color titleColor)Adds a title to an existing border, with the specified
 positioning, font and color. | 
| FontMetrics | JList.AccessibleJList.AccessibleJListChild. getFontMetrics(Font f) | 
| FontMetrics | DebugGraphics. getFontMetrics(Font f)Overrides  Graphics.getFontMetrics. | 
| FontMetrics | JTable.AccessibleJTable.AccessibleJTableCell. getFontMetrics(Font f)Gets the  FontMetricsof this object. | 
| FontMetrics | JComponent. getFontMetrics(Font font)Gets the  FontMetricsfor the specifiedFont. | 
| FontMetrics | JTree.AccessibleJTree.AccessibleJTreeNode. getFontMetrics(Font f) | 
| void | JSlider. setFont(Font font)Sets the font for this component. | 
| void | JList.AccessibleJList.AccessibleJListChild. setFont(Font f) | 
| void | DebugGraphics. setFont(Font aFont)Sets the Font used for text drawing operations. | 
| void | JTextArea. setFont(Font f)Sets the current font. | 
| void | JTextField. setFont(Font f)Sets the current font. | 
| void | JTable.AccessibleJTable.AccessibleJTableCell. setFont(Font f)Sets the  Fontof this object. | 
| void | JComponent. setFont(Font font)Sets the font for this component. | 
| void | JTree.AccessibleJTree.AccessibleJTreeNode. setFont(Font f) | 
| Modifier and Type | Field and Description | 
|---|---|
| protected Font | TitledBorder. titleFont | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Font | TitledBorder. getFont(Component c) | 
| Font | TitledBorder. getTitleFont()Returns the title-font of the titled border. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | TitledBorder. setTitleFont(Font titleFont)Sets the title-font of the titled border. | 
| Constructor and Description | 
|---|
| TitledBorder(Border border,
            String title,
            int titleJustification,
            int titlePosition,
            Font titleFont)Creates a TitledBorder instance with the specified border,
 title, title-justification, title-position, and title-font. | 
| TitledBorder(Border border,
            String title,
            int titleJustification,
            int titlePosition,
            Font titleFont,
            Color titleColor)Creates a TitledBorder instance with the specified border,
 title, title-justification, title-position, title-font, and
 title-color. | 
| Modifier and Type | Class and Description | 
|---|---|
| class  | FontUIResourceA subclass of java.awt.Font that implements UIResource. | 
| Constructor and Description | 
|---|
| FontUIResource(Font font) | 
| TitledBorderUIResource(Border border,
                      String title,
                      int titleJustification,
                      int titlePosition,
                      Font titleFont) | 
| TitledBorderUIResource(Border border,
                      String title,
                      int titleJustification,
                      int titlePosition,
                      Font titleFont,
                      Color titleColor) | 
| Modifier and Type | Field and Description | 
|---|---|
| protected Font | BasicMenuItemUI. acceleratorFont | 
| Modifier and Type | Method and Description | 
|---|---|
| protected void | BasicTabbedPaneUI. paintText(Graphics g,
         int tabPlacement,
         Font font,
         FontMetrics metrics,
         int tabIndex,
         String title,
         Rectangle textRect,
         boolean isSelected) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Font | NimbusStyle. getFontForState(SynthContext ctx)Returns the font for the specified state. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | SynthStyle. getFont(SynthContext context)Returns the Font for the specified state. | 
| protected abstract Font | SynthStyle. getFontForState(SynthContext context)Returns the font for the specified state. | 
| Modifier and Type | Method and Description | 
|---|---|
| int | SynthGraphicsUtils. computeStringWidth(SynthContext ss,
                  Font font,
                  FontMetrics metrics,
                  String text)Returns the size of the passed in string. | 
| Dimension | SynthGraphicsUtils. getMaximumSize(SynthContext ss,
              Font font,
              String text,
              Icon icon,
              int hAlign,
              int vAlign,
              int hTextPosition,
              int vTextPosition,
              int iconTextGap,
              int mnemonicIndex)Returns the maximum size needed to properly render an icon and text. | 
| Dimension | SynthGraphicsUtils. getMinimumSize(SynthContext ss,
              Font font,
              String text,
              Icon icon,
              int hAlign,
              int vAlign,
              int hTextPosition,
              int vTextPosition,
              int iconTextGap,
              int mnemonicIndex)Returns the minimum size needed to properly render an icon and text. | 
| Dimension | SynthGraphicsUtils. getPreferredSize(SynthContext ss,
                Font font,
                String text,
                Icon icon,
                int hAlign,
                int vAlign,
                int hTextPosition,
                int vTextPosition,
                int iconTextGap,
                int mnemonicIndex)Returns the preferred size needed to properly render an icon and text. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry. getFont() | 
| Modifier and Type | Method and Description | 
|---|---|
| FontMetrics | JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry. getFontMetrics(Font f) | 
| void | JTableHeader.AccessibleJTableHeader.AccessibleJTableHeaderEntry. setFont(Font f) | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | GlyphView. getFont()Fetch the font that the glyphs should be based
 upon. | 
| Font | LabelView. getFont()Fetches the font that the glyphs should be based upon. | 
| Font | DefaultStyledDocument. getFont(AttributeSet attr)Gets the font from an attribute set. | 
| Font | StyledDocument. getFont(AttributeSet attr)Takes a set of attributes and turn it into a font
 specification. | 
| Font | StyleContext. getFont(AttributeSet attr)Gets the font from an attribute set. | 
| Font | StyleContext. getFont(String family,
       int style,
       int size)Gets a new font. | 
| Modifier and Type | Method and Description | 
|---|---|
| FontMetrics | StyleContext. getFontMetrics(Font f)Returns font metrics for a font. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | StyleSheet. getFont(AttributeSet a)Fetches the font to use for the given set of attributes. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected Font | DefaultTreeCellEditor. fontFont to paint with,  nullindicates
 font of renderer is to be used. | 
| Modifier and Type | Method and Description | 
|---|---|
| Font | DefaultTreeCellEditor. getFont()Gets the font used for editing. | 
| Font | DefaultTreeCellEditor.DefaultTextField. getFont() | 
| Font | DefaultTreeCellRenderer. getFont()Gets the font of this component. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | DefaultTreeCellEditor. setFont(Font font)Sets the font to edit with. | 
| void | DefaultTreeCellRenderer. setFont(Font font)Subclassed to map  FontUIResources to null. | 
 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, 2015, Oracle and/or its affiliates.  All rights reserved.