我做了一个摇摆应用程序.现在我想更改整个Swing应用程序的Font,以便添加的任何组件都应该只跟随该Font.有没有办法实现同样的目标?
public static void setGlobalFont( Font font ) {
Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements() ) {
Object key = keys.nextElement();
Object value = UIManager.get( key );
if ( value instanceof Font ) {
UIManager.put( key, font );
}
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2402 次 |
最近记录: |