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

项目:openjdk-jdk10    文件: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);
        }
    }
项目:openjdk9    文件: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);
        }
    }
项目:AkarshMan    文件:Application.java   
private static void setupUILAF() {
    try {
        @SuppressWarnings("serial")
        LookAndFeel laf = new NimbusLookAndFeel() {
            @Override
            public UIDefaults getDefaults() {
                UIDefaults ret = super.getDefaults();
                ret.put("defaultFont", Util.normalFont);
                return ret;
            }
        };
        UIManager.setLookAndFeel(laf);
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目:Feuille    文件:XKCStep3.java   
private void init(){
    try {
        javax.swing.UIManager.setLookAndFeel(new NimbusLookAndFeel());
        javax.swing.SwingUtilities.updateComponentTreeUI(this);
    } catch (UnsupportedLookAndFeelException exc) {
        System.out.println("Nimbus LookAndFeel not loaded : "+exc);
    }

    cbMode.setModel(comboModelMode);
    for(ModeType mode : ModeType.values()){
        comboModelMode.addElement(mode);
    }
    cbMode.setSelectedIndex(0); // Force le rendu de lblSummary

    cbTreatment.setModel(comboModelTreatment);
    for(TreatmentType tr : TreatmentType.values()){
        comboModelTreatment.addElement(tr);
    }
    cbTreatment.setSelectedIndex(0); // Force le rendu de lblSummary
}
项目: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);
}
项目: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();
}
项目: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();
        }
    });
}
项目:jdk8u-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");
        }
    });
}
项目:openjdk-jdk10    文件: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);
}
项目:openjdk-jdk10    文件:bug6937798.java   
public static void main(String... args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    SwingUtilities.invokeAndWait(new Runnable() {
        public void run() {
            new bug6937798();
        }
    });
}
项目:openjdk-jdk10    文件:Test6919629.java   
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
项目:openjdk-jdk10    文件:bug8057791.java   
private static boolean tryNimbusLookAndFeel()
        throws Exception {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
        errorString += e.getMessage();
        return false;
    }
    return true;
}
项目:openjdk-jdk10    文件: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();
        }
    });
}
项目:openjdk-jdk10    文件: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");
        }
    });
}
项目:WePush    文件:Init.java   
/**
 * 初始化look and feel
 */
public static void initTheme() {

    try {
        switch (configer.getTheme()) {
            case "BeautyEye":
                BeautyEyeLNFHelper.launchBeautyEyeLNF();
                UIManager.put("RootPane.setupButtonVisible", false);
                break;
            case "weblaf":
                UIManager.setLookAndFeel(new WebLookAndFeel());
                break;
            case "系统默认":
                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
                break;
            case "Windows":
                UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName());
                break;
            case "Nimbus":
                UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
                break;
            case "Metal":
                UIManager.setLookAndFeel(MetalLookAndFeel.class.getName());
                break;
            case "Motif":
                UIManager.setLookAndFeel(MotifLookAndFeel.class.getName());
                break;
            case "Darcula(推荐)":
            default:
                UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
        }
    } catch (Exception e) {
        logger.error(e);
    }

}
项目:openjdk9    文件: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);
}
项目:openjdk9    文件:Test6919629.java   
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
项目:openjdk9    文件: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();
        }
    });
}
项目:openjdk9    文件: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");
        }
    });
}
项目:subtitle-studio    文件:Main.java   
public static void main(String[] args) {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (UnsupportedLookAndFeelException ex) {
        Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
    }

    MainWindow mainWindow = new MainWindow();
    mainWindow.setResizable(false);
    mainWindow.setLocationRelativeTo(null);
    mainWindow.setVisible(true);
}
项目: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);
}
项目: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();
}
项目: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();
        }
    });
}
项目:jdk8u_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");
        }
    });
}
项目:lookaside_java-1.8.0-openjdk    文件: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);
}
项目:lookaside_java-1.8.0-openjdk    文件:Test6919629.java   
public static void main(String[] args) throws Exception {
    UIManager.setLookAndFeel(new NimbusLookAndFeel());
    Test6919629 t = new Test6919629();
    t.test();
    System.gc();
    t.check();
}
项目:lookaside_java-1.8.0-openjdk    文件: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();
        }
    });
}
项目:lookaside_java-1.8.0-openjdk    文件: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");
        }
    });
}
项目:Haxa-Editor    文件:Editor.java   
public static void main(String[] args) {

    //Startup message
    System.out.println("Now Starting Level Editor 2.0");
    try { UIManager.setLookAndFeel(new NimbusLookAndFeel());} catch (UnsupportedLookAndFeelException e) {}

    //Open project folder
    File projectDir = Util.getDir(new File(new File("."), DIR_NAME));

    //Open the project
    new Project(projectDir).edit();
}
项目:ISeeUReceiver    文件:StreamPreview.java   
public static void main(String args[]) {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (Exception ex) {

    }

    new StreamPreview().setVisible(true);
}
项目:PyxleOS    文件:MainWindow.java   
public void updateGUI() {
    updateNimbus();

    for (Component component : mFrame.getComponents()) {
        component.repaint();
    }

    for (Window window : Window.getWindows()) {
        // SwingUtilities.updateComponentTreeUI(window);
        NimbusLookAndFeel.updateStyles(window);
    }
    updateColorButtons();
}
项目:typometer    文件:Application.java   
private static void openMainForm(String title, Parameters parameters) {
    try {
        UIManager.setLookAndFeel(new NimbusLookAndFeel());
    } catch (UnsupportedLookAndFeelException e) {
        throw new RuntimeException(e);
    }

    MainFrame form = new MainFrame(title, parameters);
    form.pack();
    form.setLocationRelativeTo(null);
    form.setVisible(true);
}
项目:dotREVO    文件:Revolution.java   
private void init(){
    try {
        javax.swing.UIManager.setLookAndFeel(new NimbusLookAndFeel());
        javax.swing.SwingUtilities.updateComponentTreeUI(this);
    } catch (UnsupportedLookAndFeelException exc) {
        System.out.println("Nimbus LookAndFeel not loaded : "+exc);
    }

    //-- dim >> Obtient la taille de l'écran
    //-- gconf >> Obtient la configuration de l'écran
    //-- insets >> Obtient les 'marges' de l'écran
    java.awt.Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit();
    java.awt.Dimension dim = toolkit.getScreenSize();
    java.awt.GraphicsConfiguration gconf = java.awt.GraphicsEnvironment
            .getLocalGraphicsEnvironment().getDefaultScreenDevice()
            .getDefaultConfiguration();
    java.awt.Insets insets = toolkit.getScreenInsets(gconf);
    setSize(dim.width - insets.left - insets.right,
            dim.height - insets.top - insets.bottom);

    s2d.setPreferredSize(new Dimension(2000, 2000));
    spSheet2D.setViewportView(s2d);
    s2d.revalidate();
    spSheet2D.updateUI();

    listConcentricShapes.setCellRenderer(new ConcentricListRenderer());
    listConcentricShapes.setModel(concentricListModel);
}
项目:infobip-open-jdk-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);
}
项目:infobip-open-jdk-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();
}
项目:infobip-open-jdk-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();
        }
    });
}
项目:infobip-open-jdk-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");
        }
    });
}
项目:jdk8u-dev-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);
}
项目:jdk8u-dev-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();
}
项目:jdk8u-dev-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();
        }
    });
}