Java Swing 修改UI字体

阅读更多

		//修改字体
		//方式一:
		for (Iterator> it = UIManager.getDefaults().entrySet().iterator(); it.hasNext();) {
			Object key = it.next().getKey();
			Object value = UIManager.get(key);
			if (value instanceof FontUIResource) {
				value = ((Font) value).deriveFont(Font.PLAIN);
				UIManager.put(key, value);
			}
		}
		//方式二:
		UIManager.put("swing.boldMetal", Boolean.FALSE); 
 

你可能感兴趣的:(Java Swing 修改UI字体)