Java Code Examples for javax.swing.plaf.nimbus.NimbusLookAndFeel

The following examples show how to use javax.swing.plaf.nimbus.NimbusLookAndFeel. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
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);
        }
    }
 
Example 2
Source Project: Pixelitor   Source File: AssertJSwingTest.java    License: GNU General Public License v3.0 6 votes vote down vote up
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();
}
 
Example 3
Source Project: dragonwell8_jdk   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 4
Source Project: dragonwell8_jdk   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 5
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();
        }
    });
}
 
Example 6
Source Project: dragonwell8_jdk   Source File: Test7048204.java    License: GNU General Public License v2.0 5 votes vote down vote up
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");
        }
    });
}
 
Example 7
Source Project: TencentKona-8   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 8
Source Project: TencentKona-8   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 9
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();
        }
    });
}
 
Example 10
Source Project: TencentKona-8   Source File: Test7048204.java    License: GNU General Public License v2.0 5 votes vote down vote up
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");
        }
    });
}
 
Example 11
Source Project: jdk8u60   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 12
Source Project: jdk8u60   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 13
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();
        }
    });
}
 
Example 14
Source Project: jdk8u60   Source File: Test7048204.java    License: GNU General Public License v2.0 5 votes vote down vote up
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");
        }
    });
}
 
Example 15
Source Project: openjdk-jdk8u   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 16
Source Project: openjdk-jdk8u   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 17
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();
        }
    });
}
 
Example 18
Source Project: openjdk-jdk8u   Source File: Test7048204.java    License: GNU General Public License v2.0 5 votes vote down vote up
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");
        }
    });
}
 
Example 19
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);
}
 
Example 20
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 21
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();
        }
    });
}
 
Example 22
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");
        }
    });
}
 
Example 23
Source Project: openjdk-jdk9   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 24
Source Project: openjdk-jdk9   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 25
Source Project: openjdk-jdk9   Source File: bug8057791.java    License: GNU General Public License v2.0 5 votes vote down vote up
private static boolean tryNimbusLookAndFeel()
        throws Exception {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
        errorString += e.getMessage();
        return false;
    }
    return true;
}
 
Example 26
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();
        }
    });
}
 
Example 27
Source Project: openjdk-jdk9   Source File: Test7048204.java    License: GNU General Public License v2.0 5 votes vote down vote up
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");
        }
    });
}
 
Example 28
Source Project: jdk8u-jdk   Source File: Test6827032.java    License: GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example 29
Source Project: jdk8u-jdk   Source File: Test6919629.java    License: GNU General Public License v2.0 5 votes vote down vote up
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
 
Example 30
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();
        }
    });
}