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


Java UIManager.LookAndFeelInfo方法代码示例

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


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

示例1: 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();
            performTest();
            robot.waitForIdle();
        }
    }
    if (!"".equals(errorMessage)) {
        throw new RuntimeException(errorMessage);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:NimbusGlueTest.java

示例2: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Throwable {
    //Execute test for all supported look and feels
    UIManager.LookAndFeelInfo[] lookAndFeelArray
            = UIManager.getInstalledLookAndFeels();

    for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
        String lookAndFeelString = lookAndFeelItem.getClassName();

        UIManager.setLookAndFeel(lookAndFeelString);

        // Test getTableCellRendererComponent method by passing null table
        JTableHeader header = new JTableHeader();

        header.getDefaultRenderer().getTableCellRendererComponent(null,
                " test ", true, true, -1, 0);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:TableHeaderRendererExceptionTest.java

示例3: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    Robot robot = new Robot();
    UIManager.LookAndFeelInfo[] lookAndFeelArray
            = UIManager.getInstalledLookAndFeels();
    for (UIManager.LookAndFeelInfo lookAndFeelItem : lookAndFeelArray) {
        String lookAndFeelString = lookAndFeelItem.getClassName();
        if (tryLookAndFeel(lookAndFeelString)) {
            // create UI
            SwingUtilities.invokeAndWait(new Runnable() {
                @Override
                public void run() {
                    createUI(lookAndFeelString);
                }
            });

            robot.waitForIdle();
            executeTest(robot);
        } else {
            throw new RuntimeException("Setting Look and Feel Failed");
        }
    }

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

示例4: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels();
    // try to test all installed Look and Feels
    for (UIManager.LookAndFeelInfo lookAndFeel : installedLookAndFeels) {
        String name = lookAndFeel.getName();
        System.out.println("Testing " + name);
        // Some Look and Feels work only when test is run in a GUI environment
        // (GTK+ LAF is an example)
        try {
            UIManager.setLookAndFeel(lookAndFeel.getClassName());
            checkTitleColor();
            System.out.println("    titleColor test ok");
            checkTitleFont();
            System.out.println("    titleFont test ok");
        }
        catch (UnsupportedLookAndFeelException e) {
            System.out.println("    Note: LookAndFeel " + name
                             + " is not supported on this configuration");
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:22,代码来源:Test7022041.java

示例5: 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

示例6: 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

示例7: setLookAndFeel

import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
    try {
        UIManager.setLookAndFeel(laf.getClassName());
        System.out.println("LookAndFeel: " + laf.getClassName());
    } catch (ClassNotFoundException | InstantiationException |
            UnsupportedLookAndFeelException | IllegalAccessException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:bug6190373.java

示例8: main

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

示例9: 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());
    }

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

示例10: test

import javax.swing.UIManager; //导入方法依赖的package包/类
private static void test(final boolean lock) {
    for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
        try {
            SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
            barrier.await();
            SwingUtilities.invokeAndWait(() -> slam(lock));
            barrier.await();
        } catch (final Exception e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:bug6190373.java

示例11: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(final String[] args) throws Exception {
    for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) {
        SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
        SwingUtilities.invokeAndWait(new MisplacedBorder());
    }
    System.out.println("Test passed");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:MisplacedBorder.java

示例12: setLookAndFeel

import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) {
    try {
        UIManager.setLookAndFeel(laf.getClassName());
    } catch (ClassNotFoundException | InstantiationException |
             UnsupportedLookAndFeelException | IllegalAccessException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:bug4697612.java

示例13: main

import javax.swing.UIManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
    robot = new Robot();
    robot.setAutoDelay(100);
    for (UIManager.LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
        try {
            SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
            System.out.println("Test for LookAndFeel " + laf.getClassName());
            new bug4870644();
            System.out.println("Test passed for LookAndFeel " + laf.getClassName());
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:bug4870644.java

示例14: setLookAndFeel

import javax.swing.UIManager; //导入方法依赖的package包/类
private static void setLookAndFeel(final UIManager.LookAndFeelInfo info) {
    try {
        UIManager.setLookAndFeel(info.getClassName());
    } catch (ClassNotFoundException | InstantiationException |
            UnsupportedLookAndFeelException | IllegalAccessException e) {
        throw new RuntimeException(e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:FileFilterDescription.java

示例15: main

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

        String tmpdir = System.getProperty("java.io.tmpdir");
        System.out.println("tmp dir " + tmpdir);
        new JFileChooser(new File(tmpdir+"/temp"));


        System.out.println("Test passed for LookAndFeel " + lookAndFeelInfo.getClassName());
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:bug6738668.java


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