import javax.swing.*;
import java.awt.*;
public class JFontJavaExample extends JFrame
{
Font BgFnt = new Font("Times New Roman", Font.ITALIC, 52);
String hello = "Hi..!";
public void paint(Graphics gp)
{
super.paint(gp);
gp.setFont(BgFnt);
gp.drawString(hello, 20, 110);
}
public static void main(String[] aa)
{
JFontJavaExample frm= new JFontJavaExample();
frm.setSize(190, 160);
frm.setVisible(true);
}
}