Change font of JLabel

我怕爱的太早我们不能终老 提交于 2021-01-27 04:18:52

问题


how to change Font of JLabel ? I try this but with no succes:

JLabel nadpis = new JLabel(); 
nadpis.setFont(new Font("Papyrus", Font.ITALIC, 100)); 
nadpis.setText("hi");

Just size is changed but Font is still same


回答1:


I didn't see papyrus in my available fonts. How can I add it?

Look in the Font methods for the createFont() variants.



来源:https://stackoverflow.com/questions/7859551/change-font-of-jlabel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!