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


Java UIManager.getInstalledLookAndFeels方法代码示例

本文整理汇总了Java中javax.swing.UIManager.getInstalledLookAndFeels方法的典型用法代码示例。如果您正苦于以下问题:Java UIManager.getInstalledLookAndFeels方法的具体用法?Java UIManager.getInstalledLookAndFeels怎么用?Java UIManager.getInstalledLookAndFeels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.UIManager的用法示例。


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

示例1: main

import javax.swing.UIManager; //导入方法依赖的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

示例2: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    robot = new Robot();
    UIManager.LookAndFeelInfo[] lookAndFeelArray
            = UIManager.getInstalledLookAndFeels();
    for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
        String lookAndFeelString = lookAndFeelItem.getClassName();
        if (tryLookAndFeel(lookAndFeelString)) {
            createUI();
            robot.waitForIdle();
            executeTest();
            robot.delay(1000);
        }
    }
    if (!"".equals(errorMessage)) {
        throw new RuntimeException(errorMessage);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:TestJInternalFrameMaximize.java

示例3: main

import javax.swing.UIManager; //导入方法依赖的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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:26,代码来源:TableExample2.java

示例4: runTest

import javax.swing.UIManager; //导入方法依赖的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

示例5: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main (String[] args) throws Exception {
	LookAndFeelInfo[] lookAndFeels = UIManager.getInstalledLookAndFeels();
	for (int i = 0, n = lookAndFeels.length; i < n; i++) {
		if ("Nimbus".equals(lookAndFeels[i].getName())) {
			try {
				UIManager.setLookAndFeel(lookAndFeels[i].getClassName());
			} catch (Exception ignored) {
			}
			break;
		}
	}
	new Hiero();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:14,代码来源:Hiero.java

示例6: setJMenuExtraLnF

import javax.swing.UIManager; //导入方法依赖的package包/类
/**
 * Set the JMenue for the look and feel.
 */
private void setJMenuExtraLnF() {

	UIManager.LookAndFeelInfo installedLnF[] = UIManager.getInstalledLookAndFeels();
	for (int i = 0, n = installedLnF.length; i < n; i++) {
		boolean setBold = installedLnF[i].getClassName().equals(Application.getGlobalInfo().getAppLookAndFeelClassName());
		jMenuExtraLnF.add(new JMenuItmenLnF(installedLnF[i].getName(), installedLnF[i].getClassName(), setBold));
	}
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:MainWindow.java

示例7: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    robot = new Robot();
    robot.delay(2000);
    UIManager.LookAndFeelInfo[] lookAndFeelArray
            = UIManager.getInstalledLookAndFeels();
    for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
        executeCase(lookAndFeelItem.getClassName());
    }
    if (!"".equals(errorString)) {
        throw new RuntimeException("Error Log:\n" + errorString);
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:JInternalFrameIconTest.java

示例8: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    robot = new Robot();
    robot.delay(1000);
    UIManager.LookAndFeelInfo[] lookAndFeelArray
            = UIManager.getInstalledLookAndFeels();
    for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
        executeCase(lookAndFeelItem.getClassName(),
                    lookAndFeelItem.getName());
    }
    if (!"".equals(errorString)) {
        throw new RuntimeException("Error Log:\n" + errorString);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:ScrollableTabbedPaneTest.java

示例9: run

import javax.swing.UIManager; //导入方法依赖的package包/类
public synchronized void run() {
    if (this.chooser == null) {
        this.chooser = new JColorChooser();

        JFrame frame = new JFrame(getClass().getName());
        frame.add(this.chooser);
        frame.setVisible(true);
    }
    else if (this.updated) {
        if (isShowing(this.chooser.getPreviewPanel())) {
            exit("custom preview panel is showing");
        }
        exit(null);
    }
    else {
        Component component = this.chooser.getPreviewPanel();
        if (component == null) {
            component = getPreview(this.chooser);
        }
        if (!isShowing(component)) {
            exit("default preview panel is not showing");
        }
        this.updated = true;
        this.chooser.setPreviewPanel(new JPanel());
    }
    LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
    LookAndFeelInfo info = infos[++this.index % infos.length];
    try {
        UIManager.setLookAndFeel(info.getClassName());
    }
    catch (Exception exception) {
        exit("could not change L&F");
    }
    SwingUtilities.updateComponentTreeUI(this.chooser);
    SwingUtilities.invokeLater(this);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:37,代码来源:Test6199676.java

示例10: main

import javax.swing.UIManager; //导入方法依赖的package包/类
/**
 * The main method.
 * 
 * @param args - Contains the supplied command-line arguments.
 */
public static void main(String [] args){
	try {
	    for(LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()){
	        if("Windows".equals(info.getName())){
	            UIManager.setLookAndFeel(info.getClassName());
	            break;
	        }
	    }
	} catch (Exception e) {
	}
	Runner RUNNER = new Runner();
	RUNNER.start();
}
 
开发者ID:jkjoschua,项目名称:poe-ladder-tracker-java,代码行数:19,代码来源:Runner.java

示例11: test

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void test() throws Exception {
    final UIManager.LookAndFeelInfo[] infos = UIManager
            .getInstalledLookAndFeels();
    for (final UIManager.LookAndFeelInfo info : infos) {
        SwingUtilities.invokeAndWait(() -> {
            final JFileChooser chooser = new JFileChooser();
            setLookAndFeel(info);
            chooser.setAcceptAllFileFilterUsed(false);
            chooser.setFileFilter(new CustomFileFilter());
            SwingUtilities.updateComponentTreeUI(chooser);
            chooser.showDialog(null, "Open");
        });
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:FileFilterDescription.java

示例12: run

import javax.swing.UIManager; //导入方法依赖的package包/类
public void run() {
    if (this.infos == null) {
        this.infos = UIManager.getInstalledLookAndFeels();
        Thread.currentThread().setUncaughtExceptionHandler(this);
        JPanel panel = new JPanel();
        panel.setBorder(this);
        this.frame = new JFrame(getClass().getSimpleName());
        this.frame.add(panel);
        this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.frame.setVisible(true);
    }
    if (this.index == this.infos.length) {
        this.frame.dispose();
    }
    else {
        LookAndFeelInfo info = this.infos[this.index % this.infos.length];
        try {
            UIManager.setLookAndFeel(info.getClassName());
        }
        catch (Exception exception) {
            System.err.println("could not change look and feel");
        }
        SwingUtilities.updateComponentTreeUI(this.frame);
        this.frame.pack();
        this.frame.setLocationRelativeTo(null);
        this.index++;
        SwingUtilities.invokeLater(this);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:Test6981576.java

示例13: pegaNimbus

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void pegaNimbus() {
    try {
        for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) {
        System.out.println("Erro: " + e.getMessage());
    }
}
 
开发者ID:limagiran,项目名称:hearthstone,代码行数:13,代码来源:AplicaNimbus.java

示例14: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
            UIManager.setLookAndFeel(info.getClassName());
            UIManager.put("FileChooser.openButtonMnemonic", KeyEvent.VK_O);
            UIManager.put("FileChooser.saveButtonMnemonic", KeyEvent.VK_S);
            runTest();
            break;
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:bug8002077.java

示例15: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    robot = new Robot();
    GraphicsEnvironment ge =
            GraphicsEnvironment.getLocalGraphicsEnvironment();
    UIManager.LookAndFeelInfo[] lookAndFeelArray =
            UIManager.getInstalledLookAndFeels();
    for (GraphicsDevice sd : ge.getScreenDevices()) {
        for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
            executeCase(lookAndFeelItem.getClassName(), sd);
            robot.waitForIdle();
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:bug7072653.java


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