javax.swing.UIManager.setInstalledLookAndFeels()方法的使用及代码示例

x33g5p2x  于2022-01-31 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中javax.swing.UIManager.setInstalledLookAndFeels()方法的一些代码示例,展示了UIManager.setInstalledLookAndFeels()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UIManager.setInstalledLookAndFeels()方法的具体详情如下:
包路径:javax.swing.UIManager
类名称:UIManager
方法名:setInstalledLookAndFeels

UIManager.setInstalledLookAndFeels介绍

暂无

代码示例

代码示例来源:origin: mucommander/mucommander

/**
 * Uninstalls the specified look and feel.
 * @param selection look and feel to uninstall.
 */
private void uninstallLookAndFeel(UIManager.LookAndFeelInfo selection) {
  UIManager.LookAndFeelInfo[] buffer;      // New array of installed look and feels.
  int                         bufferIndex; // Current index in buffer.
  // Copies the content of lookAndFeels into buffer, skipping over the look and feel to uninstall.
  buffer      = new UIManager.LookAndFeelInfo[lookAndFeels.length - 1];
  bufferIndex = 0;
  for (UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels) {
    if (!selection.getClassName().equals(lookAndFeel.getClassName())) {
      buffer[bufferIndex] = lookAndFeel;
      bufferIndex++;
    }
  }
  // Resets the list of installed look and feels.
  UIManager.setInstalledLookAndFeels(lookAndFeels = buffer);
}

代码示例来源:origin: nroduit/Weasis

public static boolean installSubstanceLookAndFeels() {
  try {
    Class.forName(CLASSES[0]);
  } catch (Exception e) {
    return false;
  }
  List<LookAndFeelInfo> tmp = new ArrayList<>();
  for (LookAndFeelInfo i : UIManager.getInstalledLookAndFeels()) {
    tmp.add(new ReadableLookAndFeelInfo(i.getName(), i.getClassName()));
  }
  for (int i = 0; i < CLASSES.length; i++) {
    tmp.add(new ReadableLookAndFeelInfo(NAMES[i], CLASSES[i]));
  }
  UIManager.setInstalledLookAndFeels(tmp.toArray(new LookAndFeelInfo[tmp.size()]));
  return true;
}

相关文章