0
我试图在JFrame中嵌入TTF字体。当然,我在各种线索中搜索了很多。我试过下面的代码片段:在Java中嵌入TTF失败
InputStream is = getClass().getResourceAsStream("abc.ttf");
Font myFont = Font.createFont(Font.TRUETYPE_FONT, is);
Font abcFont = myFont.deriveFont(Font.TRUETYPE_FONT,40);
在第二行(Font myFont = ...
)日食显示以下错误:
Multiple markers at this line:
-unhandled exception type IOException
-unhandled exception type FontFormatException
希望你知道一个解决方案! 非常感谢!