home *** CD-ROM | disk | FTP | other *** search
/ Australian PC Authority 1999 May / may1999.iso / May / JBUILDER / JSAMPLES.Z / Metalworks.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-04-30  |  1.7 KB  |  36 lines

  1. import com.sun.java.swing.UIManager;
  2. import com.sun.java.swing.UnsupportedLookAndFeelException;
  3. import com.sun.java.swing.plaf.metal.DefaultMetalTheme;
  4. import com.sun.java.swing.plaf.metal.MetalLookAndFeel;
  5. import java.awt.Component;
  6.  
  7. public class Metalworks {
  8.    public static void main(String[] var0) {
  9.       System.out.println("Starting Metalworks...");
  10.  
  11.       try {
  12.          MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
  13.          UIManager.setLookAndFeel("com.sun.java.swing.plaf.metal.MetalLookAndFeel");
  14.       } catch (UnsupportedLookAndFeelException var2) {
  15.          System.out.println("Metal Look & Feel not supported on this platform. \nProgram Terminated");
  16.          System.exit(0);
  17.       } catch (IllegalAccessException var3) {
  18.          System.out.println("Metal Look & Feel could not be accessed. \nProgram Terminated");
  19.          System.exit(0);
  20.       } catch (ClassNotFoundException var4) {
  21.          System.out.println("Metal Look & Feel could not found. \nProgram Terminated");
  22.          System.exit(0);
  23.       } catch (InstantiationException var5) {
  24.          System.out.println("Metal Look & Feel could not be instantiated. \nProgram Terminated");
  25.          System.exit(0);
  26.       } catch (Exception var6) {
  27.          System.out.println("Unexpected error. \nProgram Terminated");
  28.          ((Throwable)var6).printStackTrace();
  29.          System.exit(0);
  30.       }
  31.  
  32.       MetalworksFrame var1 = new MetalworksFrame();
  33.       ((Component)var1).setVisible(true);
  34.    }
  35. }
  36.