Java: Altering UI fonts (Nimbus) doesn't work!

后端 未结 6 1485
傲寒
傲寒 2020-12-30 12:21

I\'m referring to this Nimbus reference.

I tried to set global Font to be slightly larger:

UIManager.put(\"defaultFont\", new Font(Font.SANS_SERIF,         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-30 12:57

    Wrap your Font with FontUIResource. I had the exact same problem with UIManager colors and ColorUIResource fixed everything. Without digging through the JDK, I think there are some places where components expect (read: check via instanceof) for UIResources (maybe someone can confirm this)

提交回复
热议问题