예제 #1
0
  /** p:初始化look and feel, 把一切放到这个里面.可以让多个地方调用. */
  public static void initLookAndFeel() {
    // p:隐藏对话框的系统标题风格,用look and feel定义的标题风格.
    try {
      UIManager.setLookAndFeel(UILookAndFeel.class.getName());
    } catch (Exception e) {
      FRLogger.getLogger().log(Level.WARNING, "Substance Raven Graphite failed to initialize");
    }
    // 获取当前系统语言下设计器用的默认字体
    FRFont guiFRFont = getCurrentLocaleFont();
    // 指定UIManager中字体
    Enumeration keys = UIManager.getDefaults().keys();
    while (keys.hasMoreElements()) {
      String key = keys.nextElement().toString();

      if (key.endsWith(".font")) {
        UIManager.put(key, isTextField(key) ? getNamedFont("Dialog") : guiFRFont);
      }
    }
  }