Réglage personnalisé de la police

Je suis en train de définir une police personnalisée (bilboregular.ttf) à 2 jLabels dans mon programme
Les polices ne sont pas chargées correctement.

Voici les principaux appels de méthode:

//this should work if the build is in a jar file, otherwise it'll try to load it directly from the file path (i'm running in netbeans)
if (!setFonts("resources/bilboregular.ttf")) {
        System.out.println("=================FAILED FIRST OPTION"); //<<<<<<<< This is being displayed
if(!setFonts(System.getProperty("user.dir")+"/src/resources/bilboregular.ttf")){
            System.out.println("=================FAILED SECOND OPTION"); //<<< This is not being displayed
        }
    }

Ici est l'autre méthode:

public boolean setFonts(String s) {
    try {
jLabel3.setFont(java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, new java.io.File(s)));
jLabel4.setFont(java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, new java.io.File(s)));
        return true;
    } catch (Exception ex) {
        return false;
    }
}

OriginalL'auteur mangusbrother | 2012-12-05