Java Swing Font Set setItalicFont(JComponent jcomp)

Here you can find the source of setItalicFont(JComponent jcomp)

Description

set Italic Font

License

BSD License

Declaration

public static void setItalicFont(JComponent jcomp) 

Method Source Code

//package com.java2s;
/**// w  w  w .  j av  a  2  s. c  o  m
 * Copyright (c) 2014, by the Authors: John E Lloyd (UBC)
 *
 * This software is freely available under a 2-clause BSD license. Please see
 * the LICENSE file in the ArtiSynth distribution directory for details.
 */

import java.awt.Font;

import javax.swing.JComponent;

public class Main {
    public static void setItalicFont(JComponent jcomp) {
        Font font = jcomp.getFont();
        jcomp.setFont(new Font(font.getName(), Font.ITALIC, font.getSize()));

    }
}

Related

  1. setFont(HTMLDocument doc, Font font, Color fg)
  2. setFont(String fontName)
  3. setFontRecursively(final JComponent component, final Font font, final boolean childsOnly)
  4. setFontScale(float scale)
  5. setHtmlFont(HTMLDocument doc, Font font)
  6. setLabelProperties(JLabel label, Color color, Font font, Color bg)
  7. setMonospacedFont(JComponent component)
  8. setSwingFont(Font font)
  9. setTitleLabelFont(JLabel label)