Java examples for Swing:JLabel
Set Font for JLabel
import java.awt.Font; import javax.swing.JLabel; public class Main { public void m() { JLabel label1 = new JLabel("JLabel Font."); // create new Font Font font = new Font("Courier", Font.BOLD, 12); // set font for JLabel label1.setFont(font);/*from ww w.ja v a2 s . co m*/ } }