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)
  }
I used the code above to change all the default fonts in Scala Swin开发者_开发百科g components. I tried with Label, TitledBorder, TextField, PasswordField and Button so far. However, Label and Button are staying the same while others are using the new font. Any solution?
Maybe you should override LookAndFeel instead? It is not easy though.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论