当前位置: 首页>>代码示例>>Java>>正文


Java LookAndFeelInfo类代码示例

本文整理汇总了Java中javax.swing.UIManager.LookAndFeelInfo的典型用法代码示例。如果您正苦于以下问题:Java LookAndFeelInfo类的具体用法?Java LookAndFeelInfo怎么用?Java LookAndFeelInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LookAndFeelInfo类属于javax.swing.UIManager包,在下文中一共展示了LookAndFeelInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initializeLookAndFeel

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void initializeLookAndFeel() {

		try {

			for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {

				if ("Nimbus".equals(info.getName())) {
					UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		}

		catch (Exception exception) {

		}
	}
 
开发者ID:Gallery-of-Kaeon,项目名称:Kaeon-FUSION,代码行数:18,代码来源:IDE.java

示例2: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(String s[]) {
    // Trying to set Nimbus look and feel
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception ex) {
        Logger.getLogger(TableExample.class.getName()).log(Level.SEVERE,
                "Failed to apply Nimbus look and feel", ex);
    }

    new TableExample();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:TableExample.java

示例3: setLookAndFeel

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static boolean setLookAndFeel(String classname, String name) {
	if((classname==null||classname.isEmpty())&&(name==null||name.isEmpty()))
		return false;
	try {
		UIManager.setLookAndFeel(classname);
		usingNimbusLookAndFeel = UIManager.getLookAndFeel().getName().equals("Nimbus");
		return true;
	}	catch(Exception e_a) {
		try {
			for(LookAndFeelInfo look_and_feel:UIManager.getInstalledLookAndFeels())
				if(name.equals(look_and_feel.getName())) {
					UIManager.setLookAndFeel(look_and_feel.getClassName());
					usingNimbusLookAndFeel = UIManager.getLookAndFeel().getName().equals("Nimbus");
					return true;
				}
		} catch(Exception e_b) {}
	}
	return false;
}
 
开发者ID:kristian,项目名称:JDigitalSimulator,代码行数:20,代码来源:Guitilities.java

示例4: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(String[] args) {
    if (args.length != 5) {
        System.err.println("Needs database parameters eg. ...");
        System.err.println(
                "java TableExample2 \"jdbc:derby://localhost:1527/sample\" "
                + "org.apache.derby.jdbc.ClientDriver app app "
                + "\"select * from app.customer\"");
        return;
    }

    // Trying to set Nimbus look and feel
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception ex) {
        Logger.getLogger(TableExample2.class.getName()).log(Level.SEVERE,
                "Failed to apply Nimbus look and feel", ex);
    }

    new TableExample2(args[0], args[1], args[2], args[3], args[4]);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:TableExample2.java

示例5: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(String[] args) {
    // Trying to set Nimbus look and feel
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception ex) {
        Logger.getLogger(TableExample4.class.getName()).log(Level.SEVERE,
                "Failed to apply Nimbus look and feel", ex);
    }

    new TableExample4();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:TableExample4.java

示例6: runTest

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
private static void runTest() {
    try {
        LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
        for (LookAndFeelInfo info : lafInfo) {
            UIManager.setLookAndFeel(info.getClassName());

            for (Locale locale : LOCALES) {
                for (String key : MNEMONIC_KEYS) {
                    int mnemonic = SwingUtilities2.getUIDefaultsInt(key, locale);
                    if (mnemonic != 0) {
                        throw new RuntimeException("No mnemonic expected (" + mnemonic + ") " +
                                "for '" + key + "' " +
                                "in locale '" + locale + "' " +
                                "in Look-and-Feel '"
                                    + UIManager.getLookAndFeel().getClass().getName() + "'");
                    }
                }
            }
        }
        System.out.println("Test passed");
    } catch (Exception e) {
        exception = e;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:bug8080628.java

示例7: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
    try {
        createGUI();
        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
            final String name = laf.getName();
            if (name.contains("OS X") || name.contains("Metal")) {
                SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
                SwingUtilities.invokeAndWait(() -> {
                    for (int i = 0; i < 4000; ++i) {
                        SwingUtilities.updateComponentTreeUI(frame);
                    }
                });
            }
        }
    } finally {
        if (frame != null) { EventQueue.invokeAndWait(() -> frame.dispose()); }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:UnninstallUIMemoryLeaks.java

示例8: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    Test7024235 test = new Test7024235();
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        UIManager.setLookAndFeel(info.getClassName());

        test.test();
        try {
            ExtendedRobot robot = new ExtendedRobot();
            robot.waitForIdle(1000);
        }catch(Exception ex) {
            ex.printStackTrace();
            throw new Error("Unexpected Failure");
        }
        test.test();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:Test7024235.java

示例9: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(final String[] args) throws Exception {
    try {
        createGUI();
        for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
            final String name = laf.getName();
            if (name.contains("OS X") || name.contains("Metal")) {
                SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
                SwingUtilities.invokeAndWait(() -> {
                    for (int i = 0; i < 4000; ++i) {
                        SwingUtilities.updateComponentTreeUI(frame);
                    }
                });
            }
        }
    } finally {
        EventQueue.invokeAndWait(() -> frame.dispose());
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:UnninstallUIMemoryLeaks.java

示例10: main

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public static void main(String[] args) {
    // Try to use the "Nimbus" Look and Feel for Java. This is purely aesthetic.
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception e) {
        // If the Nimbus styling is not available, we fall back to normal styling
    }
    JFrame frame = new JFrame("Twitch Chat Analytics");
    frame.setContentPane(new AnalyticsGUI(frame).analyticsPanel);
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    frame.setLocationRelativeTo(null);
    frame.pack();
    frame.setVisible(true);
}
 
开发者ID:SebastianAigner,项目名称:spasm,代码行数:20,代码来源:AnalyticsGUI.java

示例11: setLaf

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
/**
 * Sets the Look And Feel specified by its name.
 * 
 * <p>
 * This method does not log in case of errors, so can be called before the logger is initialized.
 * </p>
 * 
 * @param lafName name of the Look And Feel to be set
 * @return the exception if any was thrown while setting the specified Look and Feel
 */
public static Exception setLaf( final String lafName ) {
	final Holder< Exception > exception = new Holder< >();
	runInEDT( new Runnable() {
		@Override
		public void run() {
			for ( final LookAndFeelInfo lookAndFeelInfo : UIManager.getInstalledLookAndFeels() )
				if ( lafName.equals( lookAndFeelInfo.getName() ) ) {
					try {
						UIManager.setLookAndFeel( lookAndFeelInfo.getClassName() );
					} catch ( final Exception e ) {
						exception.value = e;
					}
					break;
				}
		}
	} );
	
	return exception.value;
}
 
开发者ID:icza,项目名称:scelight,代码行数:30,代码来源:LGuiUtils.java

示例12: updateLookAndFeels

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
protected void updateLookAndFeels()
   {
clearButtons();
LookAndFeel currentLookAndFeel = UIManager.getLookAndFeel();
String current = currentLookAndFeel == null ? "" : currentLookAndFeel.getName();
LookAndFeelInfo[] infoArray = UIManager.getInstalledLookAndFeels();
if (infoArray == null || infoArray.length == 0) {
    return;
}

for (LookAndFeelInfo info : infoArray) {
    JRadioButtonMenuItem button = new JRadioButtonMenuItem(info.getName());
    button.setActionCommand(info.getClassName());
    if (info.getName().equals(current))
	button.setSelected(true);
    addButton(button);
}
   }
 
开发者ID:nomencurator,项目名称:taxonaut,代码行数:19,代码来源:LookAndFeelMenuItem.java

示例13: createLookAndFeelMenu

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
protected JMenu createLookAndFeelMenu() {
        JMenu menu = new LuckMenu();
        menu.setOpaque(true);
//        menu.setBackground(Color.white);
        menu.setName("lookAndFeel");
        
        // Look for toolkit look and feels first
        UIManager.LookAndFeelInfo lookAndFeelInfos[] = UIManager.getInstalledLookAndFeels();
        lookAndFeel = UIManager.getLookAndFeel().getClass().getName();
        lookAndFeelRadioGroup = new ButtonGroup();
        for(UIManager.LookAndFeelInfo lafInfo: lookAndFeelInfos) {
            menu.add(createLookAndFeelItem(lafInfo.getName(), lafInfo.getClassName()));
        }  
        // Now load any look and feels defined externally as service via java.util.ServiceLoader
        LOOK_AND_FEEL_LOADER.iterator();
        for (LookAndFeel laf : LOOK_AND_FEEL_LOADER) {           
            menu.add(createLookAndFeelItem(laf.getName(), laf.getClass().getName()));
        }
         
        return menu;
    }
 
开发者ID:freeseawind,项目名称:littleluck,代码行数:22,代码来源:SwingSet3.java

示例14: loadLookAndFeel

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
/**
 * we only want to try and load the Nimbus look and feel if it is not
 * for the MAC operating system.
 */
private void loadLookAndFeel() {
	try  {
		for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
			if ("Nimbus".equals(info.getName())) {
				UIManager.setLookAndFeel(info.getClassName());
				break;
			}
		}
	}
	catch(Exception e) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception ex) {
			// we don't care. Cause this should always work.
		}
	}
}
 
开发者ID:jwoehr,项目名称:ublu,代码行数:22,代码来源:My5250.java

示例15: createLAF

import javax.swing.UIManager.LookAndFeelInfo; //导入依赖的package包/类
public void createLAF()
{
	int num = 0;

	LookAndFeelInfo lafs[] = UIManager.getInstalledLookAndFeels();

	for (int i = 0; i < lafs.length; i++)
	{
		lafTitle.put(i, lafs[i].getName());
	}

	lafTitle.put(lafs.length + 0, "Nimrod");
	lafTitle.put(lafs.length + 1, "Nimrod - Burdeos");
	lafTitle.put(lafs.length + 2, "Nimrod - DarkGrey");
	lafTitle.put(lafs.length + 3, "Nimrod - DarkTabaco");
	lafTitle.put(lafs.length + 4, "Nimrod - LightTabaco");
	lafTitle.put(lafs.length + 5, "Nimrod - Night");
	lafTitle.put(lafs.length + 6, "Nimrod - Snow");

	lafOptions = new JComboBox(lafTitle.values().toArray(new String[0]));
}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:22,代码来源:EditableLAFControler.java


注:本文中的javax.swing.UIManager.LookAndFeelInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。