Bonjour,
je fais une applet et je voudrais changer le font dema police. J'ai implementé la méthode suivante :
public static void changePoliceCaractere(JLabel lbl) throws Exception
{
InputStream ttf;
Font police;
try {
ttf = new FileInputStream("/font/e.ttf");
police = Font.createFont(Font.TRUETYPE_FONT, ttf);
}
catch (Exception e) { //Une solution de rechange, au cas où...
police = new Font("gulim", Font.PLAIN, 60);
}
lbl.setFont(police);
}
Que j'appel dans le main comme ceci :
changePoliceCaractere(Label1);
Ca ne marche pas ... helpliz !
Partager