I\'m trying to use a special font in my JFrame, but I\'m running into problems. I have a JLabel defined like this:
private JLabel lab = new JLabel(\"Text\");
The Font you created has to be registered first in the GraphicsEnvironment
to be accessible to all and derive the size of the font:
Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResource("/CUSTOMFONT-MEDIUM.TTF").openStream());
GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
genv.registerFont(font);
// makesure to derive the size
font = font.deriveFont(12f);