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());
}
}
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);
}
}
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);
}
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();
}
}
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);
}
}
}
Aggregations