Search in sources :

Example 26 with LookAndFeelInfo

use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.

the class InsetsEncapsulation method main.

public static void main(final String[] args) throws Exception {
    for (final LookAndFeelInfo laf : getInstalledLookAndFeels()) {
        SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf));
        SwingUtilities.invokeAndWait(new InsetsEncapsulation());
    }
}
Also used : LookAndFeelInfo(javax.swing.UIManager.LookAndFeelInfo)

Example 27 with LookAndFeelInfo

use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.

the class Test6981576 method run.

public void run() {
    if (this.infos == null) {
        this.infos = UIManager.getInstalledLookAndFeels();
        Thread.currentThread().setUncaughtExceptionHandler(this);
        JPanel panel = new JPanel();
        panel.setBorder(this);
        this.frame = new JFrame(getClass().getSimpleName());
        this.frame.add(panel);
        this.frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        this.frame.setVisible(true);
    }
    if (this.index == this.infos.length) {
        this.frame.dispose();
    } else {
        LookAndFeelInfo info = this.infos[this.index % this.infos.length];
        try {
            UIManager.setLookAndFeel(info.getClassName());
        } catch (Exception exception) {
            System.err.println("could not change look and feel");
        }
        SwingUtilities.updateComponentTreeUI(this.frame);
        this.frame.pack();
        this.frame.setLocationRelativeTo(null);
        this.index++;
        SwingUtilities.invokeLater(this);
    }
}
Also used : JPanel(javax.swing.JPanel) LookAndFeelInfo(javax.swing.UIManager.LookAndFeelInfo) JFrame(javax.swing.JFrame)

Example 28 with LookAndFeelInfo

use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.

the class Test6199676 method run.

public synchronized void run() {
    if (this.chooser == null) {
        this.chooser = new JColorChooser();
        JFrame frame = new JFrame(getClass().getName());
        frame.add(this.chooser);
        frame.setVisible(true);
    } else if (this.updated) {
        if (isShowing(this.chooser.getPreviewPanel())) {
            exit("custom preview panel is showing");
        }
        exit(null);
    } else {
        Component component = this.chooser.getPreviewPanel();
        if (component == null) {
            component = getPreview(this.chooser);
        }
        if (!isShowing(component)) {
            exit("default preview panel is not showing");
        }
        this.updated = true;
        this.chooser.setPreviewPanel(new JPanel());
    }
    LookAndFeelInfo[] infos = UIManager.getInstalledLookAndFeels();
    LookAndFeelInfo info = infos[++this.index % infos.length];
    try {
        UIManager.setLookAndFeel(info.getClassName());
    } catch (Exception exception) {
        exit("could not change L&F");
    }
    SwingUtilities.updateComponentTreeUI(this.chooser);
    SwingUtilities.invokeLater(this);
}
Also used : JPanel(javax.swing.JPanel) LookAndFeelInfo(javax.swing.UIManager.LookAndFeelInfo) JFrame(javax.swing.JFrame) Component(java.awt.Component) JColorChooser(javax.swing.JColorChooser)

Example 29 with LookAndFeelInfo

use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.

the class Test6707406 method main.

public static void main(String[] args) throws Exception {
    test();
    for (LookAndFeelInfo laf : UIManager.getInstalledLookAndFeels()) {
        System.out.println(laf.getName());
        UIManager.setLookAndFeel(laf.getClassName());
        test();
    }
}
Also used : LookAndFeelInfo(javax.swing.UIManager.LookAndFeelInfo)

Example 30 with LookAndFeelInfo

use of javax.swing.UIManager.LookAndFeelInfo in project jdk8u_jdk by JetBrains.

the class bug8136998 method iterateLookAndFeels.

protected static void iterateLookAndFeels(final bug8136998 test) throws Exception {
    LookAndFeelInfo[] lafInfo = UIManager.getInstalledLookAndFeels();
    for (LookAndFeelInfo info : lafInfo) {
        try {
            UIManager.setLookAndFeel(info.getClassName());
            System.out.println("Look and Feel: " + info.getClassName());
            test.runTest();
        } catch (UnsupportedLookAndFeelException e) {
            System.out.println("Skipping unsupported LaF: " + info);
        }
    }
}
Also used : LookAndFeelInfo(javax.swing.UIManager.LookAndFeelInfo) UnsupportedLookAndFeelException(javax.swing.UnsupportedLookAndFeelException)

Aggregations

LookAndFeelInfo (javax.swing.UIManager.LookAndFeelInfo)41 IOException (java.io.IOException)7 JPanel (javax.swing.JPanel)6 UnsupportedLookAndFeelException (javax.swing.UnsupportedLookAndFeelException)6 Dimension (java.awt.Dimension)5 JFrame (javax.swing.JFrame)5 JLabel (javax.swing.JLabel)4 BorderLayout (java.awt.BorderLayout)3 File (java.io.File)3 JFileChooser (javax.swing.JFileChooser)3 Color (java.awt.Color)2 FlowLayout (java.awt.FlowLayout)2 GridLayout (java.awt.GridLayout)2 JButton (javax.swing.JButton)2 JTextField (javax.swing.JTextField)2 PropertiesPreferences (com.igormaznitsa.mindmap.swing.panel.utils.PropertiesPreferences)1 MessagesService (com.igormaznitsa.sciareto.notifications.MessagesService)1 PrinterPlugin (com.igormaznitsa.sciareto.plugins.services.PrinterPlugin)1 MainFrame (com.igormaznitsa.sciareto.ui.MainFrame)1 SplashScreen (com.igormaznitsa.sciareto.ui.UiUtils.SplashScreen)1