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

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

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

UIManager.getInstalledLookAndFeels介绍

暂无

代码示例

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

public static void main (String[] args) {
  for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    if ("Nimbus".equals(info.getName())) {
      try {
        UIManager.setLookAndFeel(info.getClassName());
      } catch (Throwable ignored) {
      }
      break;
    }
  }
  EventQueue.invokeLater(new Runnable() {
    public void run () {
      new FlameMain();
    }
  });
}

代码示例来源:origin: stackoverflow.com

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  UIManager.getInstalledLookAndFeels();
String[] plafNames = new String[plafInfos.length];
for (int ii=0; ii<plafInfos.length; ii++) {
  plafNames[ii] = plafInfos[ii].getName();
    int index = plafChooser.getSelectedIndex();
    try {
      UIManager.setLookAndFeel(
        plafInfos[index].getClassName() );
      SwingUtilities.updateComponentTreeUI(frame);
      if (pack.isSelected()) {
frame.setVisible(true);

代码示例来源:origin: SonarSource/sonarqube

for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
  if ("Nimbus".equals(info.getName())) {
   UIManager.setLookAndFeel(info.getClassName());
   break;
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

代码示例来源:origin: stackoverflow.com

import javax.swing.UIManager.LookAndFeelInfo;
import java.awt.EventQueue;
import java.awt.BorderLayout;
import javax.swing.*;
public class Frame1 {
  private JFrame frame;
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {

           for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
              if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
              }
            }
        Frame1 window = new Frame1();
          window.frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

代码示例来源:origin: stackoverflow.com

//Get Installed look and Feels
import javax.swing.UIManager;

public class InstalledLookandFeels {
public static void main(String args[]) {
  UIManager.LookAndFeelInfo laf[] = UIManager.getInstalledLookAndFeels();
  for (int i = 0, n = laf.length; i < n; i++) {
    System.out.print("LAF Name: " + laf[i].getName() + "\t");
    System.out.println("  LAF Class name: " + laf[i].getClassName());
  }
  System.exit(0);
 }
}

代码示例来源:origin: stackoverflow.com

for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
   if ("Nimbus".equals(info.getName())) {
     UIManager.setLookAndFeel(info.getClassName());
     break;
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setLocationByPlatform(true);
window.setVisible(true);

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

public static void main (String[] args) {
  for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    if ("Nimbus".equals(info.getName())) {
      try {
        UIManager.setLookAndFeel(info.getClassName());
      } catch (Throwable ignored) {
      }
      break;
    }
  }
  EventQueue.invokeLater(new Runnable() {
    public void run () {
      new FlameMain();
    }
  });
}

代码示例来源:origin: kabutz/javaspecialists

public void run() {
    JFrame frame = new JFrame("TristateCheckBoxTest");
    frame.setLayout(new GridLayout(0, 1, 15, 15));
    UIManager.LookAndFeelInfo[] lfs =
        UIManager.getInstalledLookAndFeels();
    for (UIManager.LookAndFeelInfo lf : lfs) {
      System.out.println("Look&Feel " + lf.getName());
      try {
        UIManager.setLookAndFeel(lf.getClassName());
      } catch (RuntimeException e) {
        throw e;
      } catch (Exception e) {
        throw new IllegalStateException(e);
      }
      frame.add(makePanel());
    }
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.pack();
    frame.setVisible(true);
  }
});

代码示例来源:origin: stackoverflow.com

import javax.swing.UIManager.LookAndFeelInfo;
import java.awt.EventQueue;
import java.awt.BorderLayout;
import javax.swing.*;
public class Frame1 {
  private JFrame frame;
  public static void main(String[] args) {
    EventQueue.invokeLater(new Runnable() {
      public void run() {
        try {

           for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
              if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
              }
            }
        Frame1 window = new Frame1();
          window.frame.setVisible(true);
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    });
  }

代码示例来源:origin: antlr/antlrworks

public static String getDefaultLookAndFeelName() {
  String name = UIManager.getSystemLookAndFeelClassName();
  UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
  for (UIManager.LookAndFeelInfo anInfo : info) {
    if (anInfo.getClassName().equalsIgnoreCase(name))
      return anInfo.getName();
  }
  return name;
}

代码示例来源:origin: stackoverflow.com

f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setBackground(new Color(0xfff0f0f0));
f.setLayout(new GridLayout(0, 1));
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
  UIManager.getInstalledLookAndFeels();
List<String> names = new ArrayList<String>();
for (UIManager.LookAndFeelInfo info : available) {
  names.add(info.getName());
    int index = combo.getSelectedIndex();
    try {
      UIManager.setLookAndFeel(
        available[index].getClassName());
      SwingUtilities.updateComponentTreeUI(parent);
    } catch (Exception e) {

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

public static void main (String[] args) {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
      if ("Nimbus".equals(info.getName())) {
        try {
          UIManager.setLookAndFeel(info.getClassName());
        } catch (Throwable ignored) {
        }
        break;
      }
    }
    EventQueue.invokeLater(new Runnable() {
      public void run () {
        new ParticleEditor();
      }
    });
  }
}

代码示例来源:origin: worstcase/gumshoe

private static void launchGUI(boolean hasMain) throws Exception {
  try {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
      if ("Nimbus".equals(info.getName())) {
        UIManager.setLookAndFeel(info.getClassName());
        break;
      }
    }
  } catch (Exception e) {
    // not available? will use default L&F
  }
  final boolean forceProbe = Boolean.getBoolean("gumshoe.probe.enabled");
  final boolean needProbe = forceProbe || hasMain;
  final ProbeManager probe = needProbe ? ProbeManager.getInstance() : null;
  final JFrame frame = new JFrame("Inspector");
  if( ! hasMain) {
    // if this is the only program, click X to exit (otherwise just hide)
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
  }
  frame.getContentPane().add(new GUI(frame, probe, hasMain));
  frame.pack();
  final Dimension fullScreenSize = Toolkit.getDefaultToolkit().getScreenSize();
  final int height = fullScreenSize.height;
  final int width = fullScreenSize.width;
  final Dimension unmaximizedSize = new Dimension(DEFAULT_WIDTH_PERCENT*width/100, DEFAULT_HEIGHT_PERCENT*height/100);
  frame.setSize(unmaximizedSize);
  frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
  frame.setVisible(true);
}

代码示例来源:origin: stackoverflow.com

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  if ("Nimbus".equals(info.getName())) {
    javax.swing.UIManager.setLookAndFeel(info.getClassName());
    break;
  new NewJFrame().setVisible(true);

代码示例来源:origin: ribomation/DroidAtScreen1

protected String findClassName(String lafName) {
  for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    if (info.getName().equals(lafName)) {
      return info.getClassName();
    }
  }
  return null;
}

代码示例来源:origin: stackoverflow.com

scrollPane.setRowHeaderView(headerTable);
table.setPreferredScrollableViewportSize(table.getPreferredSize());
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.add(scrollPane);
frame.add(new JButton(new AbstractAction("Toggle filter") {
frame.pack();
frame.setLocation(150, 150);
frame.setVisible(true);
  for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    if (info.getName().equals("Nimbus")) {
      UIManager.setLookAndFeel(info.getClassName());
      break;

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

public static void main (String[] args) {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
      if ("Nimbus".equals(info.getName())) {
        try {
          UIManager.setLookAndFeel(info.getClassName());
        } catch (Throwable ignored) {
        }
        break;
      }
    }
    EventQueue.invokeLater(new Runnable() {
      public void run () {
        new PreAlpha();
      }
    });
  }
}

代码示例来源:origin: antlr/antlrworks

public static String getLookAndFeelName(String className) {
  UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
  for (UIManager.LookAndFeelInfo anInfo : info) {
    if (anInfo.getClassName().equalsIgnoreCase(className))
      return anInfo.getName();
  }
  return null;
}

代码示例来源:origin: stackoverflow.com

frame.setLayout(new BorderLayout());
frame.add(jp, BorderLayout.CENTER);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
  for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
    if ("Nimbus".equals(info.getName())) {
      UIManager.setLookAndFeel(info.getClassName());
      break;

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

public static void main (String[] args) {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
      if ("Nimbus".equals(info.getName())) {
        try {
          UIManager.setLookAndFeel(info.getClassName());
        } catch (Throwable ignored) {
        }
        break;
      }
    }
    EventQueue.invokeLater(new Runnable() {
      public void run () {
        new ParticleEditor();
      }
    });
  }
}

相关文章