javax.swing.UnsupportedLookAndFeelException Java Examples
The following examples show how to use
javax.swing.UnsupportedLookAndFeelException.
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
Source File: Settings.java From sheepit-client with GNU General Public License v2.0 | 7 votes |
private void applyTheme(String theme_) { try { if (theme_.equals("light")) { UIManager.setLookAndFeel(new FlatLightLaf()); } else if (theme_.equals("dark")) { UIManager.setLookAndFeel(new FlatDarkLaf()); } // Apply the new theme FlatLaf.updateUI(); } catch (UnsupportedLookAndFeelException e1) { e1.printStackTrace(); } }
Example #2
Source File: bug8046391.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #3
Source File: bug8046391.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #4
Source File: bug8046391.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #5
Source File: MenuItemIconTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { robot = new Robot(); String name = UIManager.getSystemLookAndFeelClassName(); try { UIManager.setLookAndFeel(name); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { throw new RuntimeException("Test Failed"); } createUI(); robot.waitForIdle(); executeTest(); if (!"".equals(errorMessage)) { throw new RuntimeException(errorMessage); } }
Example #6
Source File: bug8046391.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #7
Source File: Metalworks.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); JDialog.setDefaultLookAndFeelDecorated(true); JFrame.setDefaultLookAndFeelDecorated(true); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground", "true"); try { UIManager.setLookAndFeel(new MetalLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { System.out.println( "Metal Look & Feel not supported on this platform. \n" + "Program Terminated"); System.exit(0); } JFrame frame = new MetalworksFrame(); frame.setVisible(true); }
Example #8
Source File: Main.java From jeveassets with GNU General Public License v2.0 | 6 votes |
private static void initLookAndFeel() { //Allow users to overwrite LaF if (System.getProperty("swing.defaultlaf") != null) { return; } String lookAndFeel; //lookAndFeel = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"; lookAndFeel = UIManager.getSystemLookAndFeelClassName(); //System //lookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName(); //Java //lookAndFeel = "javax.swing.plaf.nimbus.NimbusLookAndFeel"; //Nimbus //lookAndFeel = "javax.swing.plaf.metal.MetalLookAndFeel"; //Metal //lookAndFeel = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel"; //GTK+ //lookAndFeel = "com.sun.java.swing.plaf.motif.MotifLookAndFeel"; //CDE/Motif try { UIManager.setLookAndFeel(lookAndFeel); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { log.log(Level.SEVERE, "Failed to set LookAndFeel: " + lookAndFeel, ex); } }
Example #9
Source File: Metalworks.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); JDialog.setDefaultLookAndFeelDecorated(true); JFrame.setDefaultLookAndFeelDecorated(true); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground", "true"); try { UIManager.setLookAndFeel(new MetalLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { System.out.println( "Metal Look & Feel not supported on this platform. \n" + "Program Terminated"); System.exit(0); } JFrame frame = new MetalworksFrame(); frame.setVisible(true); }
Example #10
Source File: MenuItemIconTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { robot = new Robot(); String name = UIManager.getSystemLookAndFeelClassName(); try { UIManager.setLookAndFeel(name); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { throw new RuntimeException("Test Failed"); } createUI(); robot.waitForIdle(); executeTest(); if (!"".equals(errorMessage)) { throw new RuntimeException(errorMessage); } }
Example #11
Source File: bug8046391.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #12
Source File: HarcletFrame.java From IrScrutinizer with GNU General Public License v3.0 | 6 votes |
/** * Creates new form * @param panel * @param exitOnClose * @param lafClassName */ public HarcletFrame(HarcPanel panel, boolean exitOnClose, String lafClassName) { try { if (lafClassName != null) UIManager.setLookAndFeel(lafClassName); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { //error(ex); } this.exitOnClose = exitOnClose; harclet = panel; initComponents(); super.setTitle(harclet.getProgName()); super.setIconImage((new ImageIcon(HarcletFrame.class.getResource(harclet.getIconPath()))).getImage()); super.setResizable(false); if (exitOnClose) { super.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); } }
Example #13
Source File: Main.java From HubPlayer with GNU General Public License v3.0 | 6 votes |
public static void main(String[] args) { try { // 设置观感 UIManager .setLookAndFeel("org.jvnet.substance.skin.SubstanceBusinessBlackSteelLookAndFeel"); // 设置水印 SubstanceLookAndFeel .setCurrentWatermark("org.jvnet.substance.watermark.SubstanceMosaicWatermark"); // 设置渐变渲染 SubstanceLookAndFeel .setCurrentGradientPainter("org.jvnet.substance.painter.WaveGradientPainter"); JFrame.setDefaultLookAndFeelDecorated(true); JDialog.setDefaultLookAndFeelDecorated(true); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { e.printStackTrace(); } EventQueue.invokeLater(() -> { new HubFrame(); }); }
Example #14
Source File: bug8046391.java From hottub with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #15
Source File: GlyphsFrame.java From constellation with Apache License 2.0 | 6 votes |
/** * @param args the command line arguments * @throws java.io.IOException */ public static void main(String[] args) throws IOException { final String[] fontNames = loadText("fonts.txt", true); final String[] text = loadText("text.txt", false); final ParsedFontInfo pfi = FontInfo.parseFontInfo(fontNames, GlyphManagerBI.DEFAULT_FONT_SIZE); if (!pfi.messages.isEmpty()) { System.out.printf("ParsedFontInfo message: %s\n", pfi.getMessages()); } try { /* Set the system look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); //</editor-fold> } catch (final ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { Logger.getLogger(GlyphsFrame.class.getName()).log(Level.SEVERE, null, ex); } /* Create and display the form */ EventQueue.invokeLater(() -> { new GlyphsFrame(pfi.fontsInfo, text).setVisible(true); }); }
Example #16
Source File: bug8046391.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #17
Source File: Test7022041.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels(); // try to test all installed Look and Feels for (UIManager.LookAndFeelInfo lookAndFeel : installedLookAndFeels) { String name = lookAndFeel.getName(); System.out.println("Testing " + name); // Some Look and Feels work only when test is run in a GUI environment // (GTK+ LAF is an example) try { UIManager.setLookAndFeel(lookAndFeel.getClassName()); checkTitleColor(); System.out.println(" titleColor test ok"); checkTitleFont(); System.out.println(" titleFont test ok"); } catch (UnsupportedLookAndFeelException e) { System.out.println(" Note: LookAndFeel " + name + " is not supported on this configuration"); } } }
Example #18
Source File: Metalworks.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) { UIManager.put("swing.boldMetal", Boolean.FALSE); JDialog.setDefaultLookAndFeelDecorated(true); JFrame.setDefaultLookAndFeelDecorated(true); Toolkit.getDefaultToolkit().setDynamicLayout(true); System.setProperty("sun.awt.noerasebackground", "true"); try { UIManager.setLookAndFeel(new MetalLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { System.out.println( "Metal Look & Feel not supported on this platform. \n" + "Program Terminated"); System.exit(0); } JFrame frame = new MetalworksFrame(); frame.setVisible(true); }
Example #19
Source File: DebugWindow.java From mapleLemon with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) { try { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { Logger.getLogger(DebugWindow.class.getName()).log(Level.SEVERE, null, ex); } EventQueue.invokeLater(new Runnable() { @Override public void run() { new DebugWindow().setVisible(true); } }); }
Example #20
Source File: ApplicationContextGuiFactory.java From jdal with Apache License 2.0 | 6 votes |
public static void setPlasticLookAndFeel() { try { UIManager.setLookAndFeel(new Plastic3DLookAndFeel()); UIManager.put("Table.gridColor", new ColorUIResource(Color.GRAY)); UIManager.put("TableHeader.background", new ColorUIResource(220, 220, 220)); } catch (UnsupportedLookAndFeelException e) { log.error(e); } }
Example #21
Source File: MenuItemIconTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { robot = new Robot(); String name = UIManager.getSystemLookAndFeelClassName(); try { UIManager.setLookAndFeel(name); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) { throw new RuntimeException("Test Failed"); } createUI(); robot.waitForIdle(); executeTest(); if (!"".equals(errorMessage)) { throw new RuntimeException(errorMessage); } }
Example #22
Source File: Test7022041.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { UIManager.LookAndFeelInfo[] installedLookAndFeels = UIManager.getInstalledLookAndFeels(); // try to test all installed Look and Feels for (UIManager.LookAndFeelInfo lookAndFeel : installedLookAndFeels) { String name = lookAndFeel.getName(); System.out.println("Testing " + name); // Some Look and Feels work only when test is run in a GUI environment // (GTK+ LAF is an example) try { UIManager.setLookAndFeel(lookAndFeel.getClassName()); checkTitleColor(); System.out.println(" titleColor test ok"); checkTitleFont(); System.out.println(" titleFont test ok"); } catch (UnsupportedLookAndFeelException e) { System.out.println(" Note: LookAndFeel " + name + " is not supported on this configuration"); } } }
Example #23
Source File: bug8046391.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #24
Source File: JSystemFileChooser.java From FastAsyncWorldedit with GNU General Public License v3.0 | 6 votes |
public void updateUI(){ LookAndFeel old = UIManager.getLookAndFeel(); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Throwable ex) { old = null; } super.updateUI(); if(old != null){ FilePane filePane = findFilePane(this); filePane.setViewType(FilePane.VIEWTYPE_DETAILS); filePane.setViewType(FilePane.VIEWTYPE_LIST); Color background = UIManager.getColor("Label.background"); setBackground(background); setOpaque(true); try { UIManager.setLookAndFeel(old); } catch (UnsupportedLookAndFeelException ignored) {} // shouldn't get here } }
Example #25
Source File: bug8046391.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { OSType type = OSInfo.getOSType(); if (type != OSType.WINDOWS) { System.out.println("This test is for Windows only... skipping!"); return; } SwingUtilities.invokeAndWait(() -> { try { UIManager.setLookAndFeel(new WindowsLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { e.printStackTrace(); } System.out.println("Creating JFileChooser..."); JFileChooser fileChooser = new JFileChooser(); System.out.println("Test passed: chooser = " + fileChooser); }); // Test fails if creating JFileChooser hangs }
Example #26
Source File: Test.java From mars-sim with GNU General Public License v3.0 | 5 votes |
public Test() { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } JButton manage = new JButton("Manage"); JButton add = new JButton("Add"); JButton search = new JButton("Search"); JButton exit = new JButton("Exit"); CustomToolBar tb = new CustomToolBar(); tb.add(manage); tb.add(add); tb.add(search); tb.add(exit); JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(new TestPane()); frame.add(tb, BorderLayout.NORTH); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } }); }
Example #27
Source File: NimbusGlueTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private static boolean tryLookAndFeel(String lookAndFeelString) { try { UIManager.setLookAndFeel(lookAndFeelString); return true; } catch (UnsupportedLookAndFeelException | ClassNotFoundException | InstantiationException | IllegalAccessException e) { errorMessage += e.getMessage() + "\n"; System.err.println("Caught Exception: " + e.getMessage()); return false; } }
Example #28
Source File: FileFilterDescription.java From hottub with GNU General Public License v2.0 | 5 votes |
private static void setLookAndFeel(final UIManager.LookAndFeelInfo info) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) { throw new RuntimeException(e); } }
Example #29
Source File: DimensionEncapsulation.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private static void setLookAndFeel(final LookAndFeelInfo laf) { try { UIManager.setLookAndFeel(laf.getClassName()); System.out.println("LookAndFeel: " + laf.getClassName()); } catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) { throw new RuntimeException(e); } }
Example #30
Source File: bug8136998.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
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); } } }