Java examples for 2D Graphics:Font
Create Bold and Italic Font
import java.applet.Applet; import java.awt.Font; import java.awt.Graphics; public class Main { public void paint(Graphics g) { Font myFont = new Font("Courier", Font.BOLD | Font.ITALIC ,20); g.setFont(myFont);//from ww w . j a va 2 s . c om g.drawString("Bold & Italic Font Example", 10, 50); } }