Here you can find the source of setItalicFont(JComponent jcomp)
public static void setItalicFont(JComponent jcomp)
//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())); } }