List of usage examples for com.jgoodies.looks FontSets createDefaultFontSet
public static FontSet createDefaultFontSet(Font controlFont, Font menuFont, Font titleFont)
From source file:com.jtstand.swing.MainFrame.java
License:Open Source License
public static void setLookAndFeel() { try {/*from ww w . j a v a 2s. com*/ // String crosslaf = UIManager.getCrossPlatformLookAndFeelClassName(); // System.out.println("Cross Platfowm Look & Feel:" + crosslaf); String systemlaf = UIManager.getSystemLookAndFeelClassName(); // System.out.println("System Look & Feel:" + systemlaf); String nimbus = null; String windows = null; LookAndFeelInfo[] lafis = UIManager.getInstalledLookAndFeels(); log.info("Installed Look & Feels:"); for (int i = 0; i < lafis.length; i++) { LookAndFeelInfo lafi = lafis[i]; String name = lafi.getName(); log.info("[" + i + "]=" + name); if ("Nimbus".equals(name)) { nimbus = lafi.getClassName(); } else if ("Windows".equals(name)) { windows = lafi.getClassName(); } } // if (windows != null) { // UIManager.setLookAndFeel(windows); // return; // } UIManager.put(Options.USE_SYSTEM_FONTS_APP_KEY, Boolean.TRUE); FontSet fontSet = FontSets.createDefaultFontSet( // new Font("Tahoma", Font.PLAIN, 11), // control font // new Font("Tahoma", Font.PLAIN, 11), // menu font // new Font("Tahoma", Font.PLAIN, 11) // title font // new Font("Sans", Font.PLAIN, 11), // control font // new Font("Sans", Font.PLAIN, 11), // menu font // new Font("Sans", Font.PLAIN, 11) // title font new Font("Verdana", Font.PLAIN, 12), // control font new Font("Verdana", Font.PLAIN, 12), // menu font new Font("Verdana", Font.PLAIN, 12) // title font ); FontPolicy fixedPolicy = FontPolicies.createFixedPolicy(fontSet); PlasticXPLookAndFeel.setFontPolicy(fixedPolicy); UIManager.setLookAndFeel(new PlasticXPLookAndFeel()); // System.out.println("getControlTextFont:" + PlasticXPLookAndFeel.getControlTextFont()); // System.out.println("getTitleTextFont:" + PlasticXPLookAndFeel.getTitleTextFont()); // System.out.println("getMenuTextFont:" + PlasticXPLookAndFeel.getMenuTextFont()); // System.out.println("getPlasticTheme:" + PlasticXPLookAndFeel.getPlasticTheme()); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); //UIManager.setLookAndFeel(systemlaf); } catch (Exception ex) { log.error("Exception", ex); } }