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

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

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

UIManager.getCrossPlatformLookAndFeelClassName介绍

暂无

代码示例

代码示例来源:origin: net.sf.squirrel-sql.plugins/laf

public LAFPreferences()
{
  super();
  _lafClassName = UIManager.getCrossPlatformLookAndFeelClassName();
}
public LAFPreferences(IIdentifier id)

代码示例来源:origin: SKCraft/SKMCLauncher

/**
 * Try to set a safe look and feel.
 */
public static void setSafeLookAndFeel() {
  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
  } catch (Throwable e) {
  }
}

代码示例来源:origin: blurpy/kouchat

/**
 * Checks if the system look and feel differs
 * from the cross platform look and feel.
 *
 * @return True if the system look and feel is different
 * from the cross platform look and feel.
 */
public boolean isSystemLookAndFeelSupported() {
  return !UIManager.getSystemLookAndFeelClassName().equals(UIManager.getCrossPlatformLookAndFeelClassName());
}

代码示例来源:origin: org.riedelcastro/whatswrong

private static void changeUI(boolean system) {
    try {
      // Set System L&F
//      UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel");
      UIManager.setLookAndFeel(system ?
        UIManager.getSystemLookAndFeelClassName() :
        UIManager.getCrossPlatformLookAndFeelClassName());
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

private static String checkLafName(String laf){
  if (JMeterMenuBar.SYSTEM_LAF.equalsIgnoreCase(laf)){
    return UIManager.getSystemLookAndFeelClassName();
  }
  if (JMeterMenuBar.CROSS_PLATFORM_LAF.equalsIgnoreCase(laf)){
    return UIManager.getCrossPlatformLookAndFeelClassName();
  }
  return laf;
}

代码示例来源:origin: net.java.dev.designgridlayout/designgridlayout

@Override public void actionPerformed(ActionEvent e)
  {
    setLaf(UIManager.getCrossPlatformLookAndFeelClassName());
  }
};

代码示例来源:origin: org.openspml/openspml

public static void main(String[] args) {

  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
  }
  catch(Exception e) {
    e.printStackTrace();
  }

  new Browser();
  }
}

代码示例来源:origin: org.swinglabs.swingx/swingx-all

/**
 * {@inheritDoc}
 */
@Override
protected boolean matches() {
  LookAndFeel laf = getLookAndFeel();
  
  if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) {
    //just in case someone sets Nimbus as the cross platform Look and Feel
    return !laf.getID().equals("Nimbus");
  }
  
  return getLookAndFeel() instanceof MetalLookAndFeel;
}

代码示例来源:origin: de.unkrig/antology

/**
 * Load the "cross-platform look-and-feel" (a.k.a. "Metal").
 */
public void
setCrossPlatform(boolean value) {
  if (value) this.setClassName(UIManager.getCrossPlatformLookAndFeelClassName());
}

代码示例来源:origin: org.swinglabs.swingx/swingx-plaf

/**
 * {@inheritDoc}
 */
@Override
protected boolean matches() {
  LookAndFeel laf = getLookAndFeel();
  
  if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) {
    //just in case someone sets Nimbus as the cross platform Look and Feel
    return !laf.getID().equals("Nimbus");
  }
  
  return getLookAndFeel() instanceof MetalLookAndFeel;
}

代码示例来源:origin: org.bidib.jbidib.swinglabs.swingx/swingx-plaf

/**
 * {@inheritDoc}
 */
@Override
protected boolean matches() {
  LookAndFeel laf = getLookAndFeel();
  
  if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) {
    //just in case someone sets Nimbus as the cross platform Look and Feel
    return !laf.getID().equals("Nimbus");
  }
  
  return getLookAndFeel() instanceof MetalLookAndFeel;
}

代码示例来源:origin: net.sf.jga/jga

static public void main(String[] args) {
  printStartupHeader();
  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
  }
  catch (Exception x) {
    // TODO: log this instead of simply dumping it
    System.err.println("Error loading L&F:" +x);
  }
   // TODO: do command line processing
  new WebStart();
}

代码示例来源:origin: net.sf.jga/jga

static public void main(String[] args) {
  printStartupHeader();
  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
  }
  catch (Exception x) {
    // TODO: log this instead of simply dumping it
    System.err.println("Error loading L&F:" +x);
  }
  
  // TODO: do command line processing
  new Application();
}

代码示例来源:origin: org.apache.jmeter/ApacheJMeter_core

/**
 * Get a list of all installed LAFs plus CrossPlatform and System.
 * 
 * @return The list of available {@link LookAndFeelInfo}s
 */
// This is also used by LookAndFeelCommand
public static LookAndFeelInfo[] getAllLAFs() {
  UIManager.LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels();
  int i = lafs.length;
  UIManager.LookAndFeelInfo[] lafsAll = new UIManager.LookAndFeelInfo[i+2];
  System.arraycopy(lafs, 0, lafsAll, 0, i);
  lafsAll[i++]=new UIManager.LookAndFeelInfo(CROSS_PLATFORM_LAF,UIManager.getCrossPlatformLookAndFeelClassName());
  lafsAll[i]=new UIManager.LookAndFeelInfo(SYSTEM_LAF,UIManager.getSystemLookAndFeelClassName());
  return lafsAll;
}

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

public static String getLookAndFeelClassName(String name) {
  if(name == null) {
    if(XJSystem.isLinux()) {
      return UIManager.getCrossPlatformLookAndFeelClassName();
    } else {
      return UIManager.getSystemLookAndFeelClassName();                
    }
  }
  UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels();
  for (UIManager.LookAndFeelInfo anInfo : info) {
    if (anInfo.getName().equalsIgnoreCase(name))
      return anInfo.getClassName();
  }
  return null;
}

代码示例来源:origin: net.sf.sfac/sfac-core

/**
 * Restore the look-and-feel stored in the settings.
 */
private void restoreLookAndFeel() {
  // get initial look and feel from properties
  String defaultLookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName();
  String startLookAndFeel = setts.getStringProperty(LookAndFeelHelper.LOOK_AND_FEEL_KEY, defaultLookAndFeel);
  try {
    setLookAndFeel(startLookAndFeel);
  } catch (Exception e) {
    ExceptionDialog.showExceptionDialog(null, "Look & Feel error", "Cannot set look & feel:\n" + startLookAndFeel
        + "\n -> Will use default one.", e);
  }
}

代码示例来源:origin: palantir/Cinch

public static void main(String[] args) {
  Examples.initializeLogging();
  // set to Metal LaF
  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    EventQueue.invokeAndWait(new Runnable() {
      public void run() {
        new OnChangeExample();
      }
    });
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: palantir/Cinch

public static void main(String[] args) throws InterruptedException, InvocationTargetException {
  Examples.initializeLogging();
  // set to Metal LaF
  try {
    UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
    EventQueue.invokeAndWait(new Runnable() {
      public void run() {
        new BoundExtentsExample();
      }
    });
  } catch (Exception e) {
    e.printStackTrace();
  }
}

代码示例来源:origin: palantir/Cinch

public static void main(String[] args) throws InterruptedException, InvocationTargetException {
    Examples.initializeLogging();
    // set to Metal LaF
    try {
      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
      EventQueue.invokeAndWait(new Runnable() {
        public void run() {
          new FocusChangedExample();
        }
      });
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: palantir/Cinch

public static void main(String[] args) throws InterruptedException, InvocationTargetException {
    Examples.initializeLogging();
    // set to Metal LaF
    try {
      UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
      EventQueue.invokeAndWait(new Runnable() {
        public void run() {
          new BoundLocationExample();
        }
      });
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

相关文章