Java Swing Font Change changeFontToItalic(final JComponent component)

Here you can find the source of changeFontToItalic(final JComponent component)

Description

Changes the font of a component to ITALIC.

License

Apache License

Parameter

Parameter Description
component component whose font to be changed to ITALIC

Return

the component

Declaration

public static JComponent changeFontToItalic(final JComponent component) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.awt.Font;

import javax.swing.JComponent;

public class Main {
    /**/*from  ww  w  .j  a  v a  2 s . c  o m*/
     * Changes the font of a component to ITALIC.
     * @param component component whose font to be changed to ITALIC
     * @return the component
     */
    public static JComponent changeFontToItalic(final JComponent component) {
        component.setFont(component.getFont().deriveFont(Font.ITALIC));
        return component;
    }
}

Related

  1. changeFont(JComponent comp, double scaleFactor, int style)
  2. ChangeFont(JComponent comp, int wheel_rotation)
  3. changeFontSize(final int size)
  4. changeFontSize(Font font, float factor)
  5. changeFontStyle(Font font, int style)
  6. installFont(Component c, Font font)
  7. installFont(Component c, Font font)