font = new Font("San Serif", Font.PLAIN, 24)
val keys = UIManager.getDefaults().keys()
while (keys.hasMoreElements()) {
val key = keys.nextElement()
val value = UIManager get key
if (value.isInstanceOf[FontUIResource])
UIManager.put(key, font)
}我使用上面的代码更改了Scala Swing组件中的所有默认字体。到目前为止,我尝试过Label,TitledBorder,TextField,PasswordField和Button。但是,当其他人使用新字体时,Label和Button保持不变。有什么解决方案吗?
发布于 2010-09-10 01:43:19
也许你应该重写LookAndFeel?不过,这并不容易。
https://stackoverflow.com/questions/3679002
复制相似问题