Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change font of JLabel

how to change Font of JLabel ? I try this but with no succes:

JLabel nadpis = new JLabel(); 
nadpis.setFont(new Font("Papyrus", Font.ITALIC, 100)); 
nadpis.setText("hi");

Just size is changed but Font is still same

like image 351
hudi Avatar asked Oct 22 '11 12:10

hudi


1 Answers

I didn't see papyrus in my available fonts. How can I add it?

Look in the Font methods for the createFont() variants.

like image 84
Andrew Thompson Avatar answered Oct 23 '22 14:10

Andrew Thompson