0
swing에서 JTable에 사용자 정의 글꼴을로드하려고합니다.자바 글꼴 createFont가 작동하지 않습니다 (IOException)
private void carregar_font(){
try {
URL fontName = getClass().getResource("fonts/open.ttf");
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
ge.registerFont(Font.createFont(Font.TRUETYPE_FONT, new File(fontName.toString())));
} catch (IOException e) {
e.printStackTrace();
} catch(FontFormatException e) {
e.printStackTrace();
}
}
이 나에게 IOException가 제공된다 이 내가 할 방법이다. 어떠한 제안? 감사합니다
getResourceAsStream 및 other Font.createFont method을 사용하십시오. 정확한 [mcve]와 정확한 스택 추적을 게시 하시겠습니까? – Frakcool
당신은 메이븐을 사용하고 있습니까? –
@Mdkhirulashik, noope –