I am trying to add custom font to my jswing application, and i can't find how to properly upload the .ttf file so that i can use it once i create a executable jar file.
problem here, new File(getClass().getResourceAsStream("/"+"cs_regular.ttf"))
thank you!
try {
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(getClass().getResourceAsStream("/"+"cs_regular.ttf"))));
} catch (FontFormatException|IOException e) {
pr("Error_107");
}