gpt4 book ai didi

java - 更改 JLabel 的字体

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:28:43 25 4
gpt4 key购买 nike

如何改变 JLabel 的字体?我尝试了这个但没有成功:

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

只是大小改变了,但字体还是一样

最佳答案

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

查看 Font methods对于 createFont() 变体。

关于java - 更改 JLabel 的字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7859551/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com