UI 전체 바꾸기
FontUtil.setUIFont (new FontUIResource(
DEFAULT_TITLE_FONT_NAME,
DEFAULT_TITLE_FONT_STYLE,
DEFAULT_TITLE_FONT_SIZE));
import java.util.*;
import javax.swing.*;
import javax.swing.plaf.*;
public class FontUtil {
public static void setUIFont(FontUIResource f) {
Enumeration<Object> keys = UIManager.getDefaults().keys();
while (keys.hasMoreElements()) {
Object key = keys.nextElement();
Object value = UIManager.get(key);
if (value instanceof FontUIResource) {
UIManager.put(key, f);
}
}
}
}
특정 컴포넌트 바꾸기
UIManager.put("TextPane.font", DEFAULT_TEXT_FONT);