[Solved] Syntax errors, but i see no errors


You can’t declare a try-catch in class level scope, just put it inside a method. Here is an example with a possible constructor that initializes your members:

public SlickTTF(){
    try{
        awtFont = Font.createFont(Font.TRUETYPE_FONT, fontFile);
        awtFont = awtFont.deriveFont(20f);
        font = new TrueTypeFont(awtFont, true);
    }catch(Exception e){}
}

Now you can create an SlickTTF object as SlickTTF example = new SlickTTF() and it will have the class attributes initialized correctly

0

solved Syntax errors, but i see no errors