Search in sources :

Example 1 with MetalLookAndFeel

use of javax.swing.plaf.metal.MetalLookAndFeel in project jdk8u_jdk by JetBrains.

the class Test8039750 method main.

public static void main(String[] args) {
    UIDefaults table = new MetalLookAndFeel().getDefaults();
    test(table.get("ToolBar.rolloverBorder"), "javax.swing.plaf.metal.MetalBorders$ButtonBorder", "javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
    test(table.get("ToolBar.nonrolloverBorder"), "javax.swing.plaf.metal.MetalBorders$ButtonBorder", "javax.swing.plaf.metal.MetalBorders$RolloverMarginBorder");
    test(table.get("RootPane.frameBorder"), "javax.swing.plaf.metal.MetalBorders$FrameBorder");
    test(table.get("RootPane.plainDialogBorder"), "javax.swing.plaf.metal.MetalBorders$DialogBorder");
    test(table.get("RootPane.informationDialogBorder"), "javax.swing.plaf.metal.MetalBorders$DialogBorder");
    test(table.get("RootPane.errorDialogBorder"), "javax.swing.plaf.metal.MetalBorders$ErrorDialogBorder");
    test(table.get("RootPane.colorChooserDialogBorder"), "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
    test(table.get("RootPane.fileChooserDialogBorder"), "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
    test(table.get("RootPane.questionDialogBorder"), "javax.swing.plaf.metal.MetalBorders$QuestionDialogBorder");
    test(table.get("RootPane.warningDialogBorder"), "javax.swing.plaf.metal.MetalBorders$WarningDialogBorder");
}
Also used : UIDefaults(javax.swing.UIDefaults) MetalLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel)

Example 2 with MetalLookAndFeel

use of javax.swing.plaf.metal.MetalLookAndFeel in project jdk8u_jdk by JetBrains.

the class bug7068740 method main.

public static void main(String[] args) throws Exception {
    try {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
        setUp();
        doTest();
    } catch (UnsupportedLookAndFeelException e) {
        e.printStackTrace();
        throw new RuntimeException("Test failed");
    }
}
Also used : MetalLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel)

Example 3 with MetalLookAndFeel

use of javax.swing.plaf.metal.MetalLookAndFeel in project jdk8u_jdk by JetBrains.

the class MouseComboBoxTest method main.

public static void main(String[] args) throws Exception {
    toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
    robot = new Robot();
    robot.setAutoDelay(50);
    UIManager.setLookAndFeel(new MetalLookAndFeel());
    SwingUtilities.invokeAndWait(new Runnable() {

        @Override
        public void run() {
            createAndShowGUI();
        }
    });
    toolkit.realSync();
    for (int i = 0; i < items.length; i++) {
        // Open popup
        robot.keyPress(KeyEvent.VK_DOWN);
        robot.keyRelease(KeyEvent.VK_DOWN);
        toolkit.realSync();
        Point point = getItemPointToClick(i);
        robot.mouseMove(point.x, point.y);
        robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
        robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
        toolkit.realSync();
        if (i != getSelectedIndex()) {
            throw new RuntimeException("Test Failed! Incorrect value of selected index = " + getSelectedIndex() + ", expected value = " + i);
        }
    }
}
Also used : MetalLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel)

Example 4 with MetalLookAndFeel

use of javax.swing.plaf.metal.MetalLookAndFeel in project jdk8u_jdk by JetBrains.

the class bug8048506 method main.

public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new MetalLookAndFeel());
    SwingUtilities.invokeAndWait(new Runnable() {

        @Override
        public void run() {
            createAndShowGUI();
        }
    });
    System.out.println("The test passed");
}
Also used : MetalLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel)

Example 5 with MetalLookAndFeel

use of javax.swing.plaf.metal.MetalLookAndFeel in project jdk8u_jdk by JetBrains.

the class bug7170310 method main.

public static void main(String[] args) throws Exception {
    try {
        UIManager.setLookAndFeel(new MetalLookAndFeel());
        SwingUtilities.invokeAndWait(bug7170310::createAndShowUI);
        SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
        toolkit.realSync();
        for (int i = 0; i < TABS_NUMBER; i++) {
            SwingUtilities.invokeAndWait(bug7170310::addTab);
            toolkit.realSync();
        }
        SwingUtilities.invokeAndWait(bug7170310::check);
        if (exception != null) {
            System.out.println("Test failed: " + exception.getMessage());
            throw exception;
        } else {
            System.out.printf("Test passed");
        }
    } finally {
        frame.dispose();
    }
}
Also used : SunToolkit(sun.awt.SunToolkit) MetalLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel)

Aggregations

MetalLookAndFeel (javax.swing.plaf.metal.MetalLookAndFeel)18 LookAndFeel (javax.swing.LookAndFeel)3 MetalTheme (javax.swing.plaf.metal.MetalTheme)3 ValueNamePair (org.compiere.util.ValueNamePair)3 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)2 AppContext (sun.awt.AppContext)2 SunToolkit (sun.awt.SunToolkit)2 DarculaLaf (com.intellij.ide.ui.laf.darcula.DarculaLaf)1 File (java.io.File)1 IOException (java.io.IOException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 Charset (java.nio.charset.Charset)1 Level (java.util.logging.Level)1 Preferences (java.util.prefs.Preferences)1 JFrame (javax.swing.JFrame)1 UIDefaults (javax.swing.UIDefaults)1 FontUIResource (javax.swing.plaf.FontUIResource)1 DefaultMetalTheme (javax.swing.plaf.metal.DefaultMetalTheme)1