- private static boolean setCrossPlatformLookAndFeel() {
- boolean set = false;
- try
- {
- UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
- set = true;
- } catch (Exception ex)
- {
- System.err.println("Unexpected Look and Feel Exception");
- ex.printStackTrace();
- }
- return set;
+ private static boolean setCrossPlatformLookAndFeel()
+ {
+ boolean set = false;
+ try
+ {
+ UIManager.setLookAndFeel(
+ UIManager.getCrossPlatformLookAndFeelClassName());
+ set = true;
+ } catch (Exception ex)
+ {
+ System.err.println("Unexpected Look and Feel Exception");
+ ex.printStackTrace();
+ }
+ return set;
+ }
+
+ private static boolean setSystemLookAndFeel()
+ {
+ boolean set = false;
+ try
+ {
+ UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+ set = true;
+ } catch (Exception ex)
+ {
+ System.err.println("Unexpected Look and Feel Exception");
+ ex.printStackTrace();
+ }
+ return set;
+ }
+
+ private static boolean setGtkLookAndFeel()
+ {
+ boolean set = false;
+ String laf = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
+ try
+ {
+ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+ if (info.getName() != null && info.getName().startsWith("Gtk")) {
+ laf = info.getClassName();
+ break;
+ }
+ }
+ UIManager.setLookAndFeel(laf);
+ set = true;
+ } catch (Exception ex)
+ {
+ System.err.println("Unexpected Look and Feel Exception");
+ ex.printStackTrace();
+ }
+ return set;
+ }
+
+ private static boolean setMetalLookAndFeel()
+ {
+ boolean set = false;
+ String laf = "javax.swing.plaf.metal.MetalLookAndFeel";
+ try
+ {
+ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+ if (info.getName() != null && info.getName().equals("Metal")) {
+ laf = info.getClassName();
+ break;
+ }
+ }
+ UIManager.setLookAndFeel(laf);
+ set = true;
+ } catch (Exception ex)
+ {
+ System.err.println("Unexpected Look and Feel Exception");
+ ex.printStackTrace();
+ }
+ return set;