當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。