类javax.swing.plaf.nimbus.NimbusLookAndFeel源码实例Demo

下面列出了怎么用javax.swing.plaf.nimbus.NimbusLookAndFeel的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: openjdk-jdk9   文件: TitledBorderLabelUITest.java
private static void createAndShowGUI() {

        try {
            UIManager.setLookAndFeel(new TestLookAndFeel());

            JLabel label = new JLabel("Test Label");
            label.setSize(SIZE, SIZE);
            TitledBorder border = new TitledBorder("ABCDEF");
            label.setBorder(new TitledBorder(border));

            if (useLAF) {
                UIManager.setLookAndFeel(new NimbusLookAndFeel());
            } else {
                UIManager.getDefaults().put("LabelUI", MetalLabelUI.class.getName());
            }

            SwingUtilities.updateComponentTreeUI(label);

            paintToImage(label);

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
 
源代码2 项目: Pixelitor   文件: AssertJSwingTest.java
private void testTipOfTheDay() {
    var laf = EDT.call(UIManager::getLookAndFeel);

    runMenuCommand("Tip of the Day");
    var dialog = findDialogByTitle("Tip of the Day");
    if (laf instanceof NimbusLookAndFeel) {
        findButtonByText(dialog, "Next >").click();
        findButtonByText(dialog, "Next >").click();
        findButtonByText(dialog, "< Back").click();
    } else {
        findButtonByText(dialog, "Next Tip").click();
        findButtonByText(dialog, "Next Tip").click();
    }
    findButtonByText(dialog, "Close").click();
    dialog.requireNotVisible();
}
 
源代码3 项目: dragonwell8_jdk   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码4 项目: dragonwell8_jdk   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码5 项目: dragonwell8_jdk   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码6 项目: dragonwell8_jdk   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码7 项目: TencentKona-8   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码8 项目: TencentKona-8   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码9 项目: TencentKona-8   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码10 项目: TencentKona-8   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码11 项目: jdk8u60   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码12 项目: jdk8u60   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码13 项目: jdk8u60   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码14 项目: jdk8u60   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码15 项目: openjdk-jdk8u   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码16 项目: openjdk-jdk8u   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码17 项目: openjdk-jdk8u   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码18 项目: openjdk-jdk8u   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码20 项目: openjdk-jdk8u-backup   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码22 项目: openjdk-jdk8u-backup   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码23 项目: openjdk-jdk9   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);


    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    robot.waitForIdle();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码24 项目: openjdk-jdk9   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码25 项目: openjdk-jdk9   文件: bug8057791.java
private static boolean tryNimbusLookAndFeel()
        throws Exception {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
        errorString += e.getMessage();
        return false;
    }
    return true;
}
 
源代码26 项目: openjdk-jdk9   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
源代码27 项目: openjdk-jdk9   文件: Test7048204.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new JLabel();

            UIDefaults uid = UIManager.getDefaults();
            uid.putDefaults(new Object[0]);
            uid.put("what.ever", "else");
        }
    });
}
 
源代码28 项目: jdk8u-jdk   文件: Test6827032.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());

    Robot robot = new Robot();
    robot.setAutoDelay(50);

    SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            createAndShowGUI();
        }
    });

    toolkit.realSync();

    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel");
            point = previewPanel.getLocationOnScreen();
        }
    });

    point.translate(5, 5);

    robot.mouseMove(point.x, point.y);
    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
}
 
源代码29 项目: jdk8u-jdk   文件: Test6919629.java
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
源代码30 项目: jdk8u-jdk   文件: ColorCustomizationTest.java
public static void main(String[] args) throws Exception {
    nimbus = new NimbusLookAndFeel();
    try {
        UIManager.setLookAndFeel(nimbus);
    } catch (UnsupportedLookAndFeelException e) {
        throw new Error("Unable to set Nimbus LAF");
    }
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override public void run() {
            new ColorCustomizationTest().test();
        }
    });
}
 
 类所在包
 同包方法