--sunfruit
为JAVA的图形界面的字体设置统一的格式
执行下列代码
//设置系统的默认字体
private static void setUIFont() {
Font myFont = new Font("宋体", 9, 12);
javax.swing.plaf.FontUIResource fontRes = new javax.swing.plaf.
FontUIResource(myFont);
java.util.Enumeration keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof javax.swing.plaf.FontUIResource) {
UIManager.put(key, fontRes);
}
}
}