try {
font = Font.createFont(Font.TRUETYPE_FONT,new File("C:\\Users\\lenovo\\Desktop\\fonts\\digital-7.ttf") );
} catch (FontFormatException | IOException ex) {
Logger.getLogger(Calculator.class.getName()).log(Level.SEVERE, null, ex);
}
font = font.deriveFont(Font.PLAIN,30);
GraphicsEnvironment ge =
GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(font);
此方法无效。