FileDocCategorySizeDatePackage
BackFromTheDead.javaAPI DocExample975Mon May 01 14:42:06 BST 2000None

BackFromTheDead

public class BackFromTheDead extends JFrame

Fields Summary
Constructors Summary
public BackFromTheDead()

    super("Revived Beans!");
    try {
      Object bean = Beans.instantiate(
        getClass().getClassLoader(  ), "tipcalc" );

      if ( Beans.isInstanceOf(bean, Component.class) ) {
        Component comp = (Component)
          Beans.getInstanceOf(bean, Component.class);
        getContentPane(  ).add("Center", comp);
      } else {
          System.out.println("Bean is not a Component...");
      }
    }

    catch ( java.io.IOException e1 ) {
      System.out.println("Error loading the serialized object");
    }

    catch ( ClassNotFoundException e2 ) {
      System.out.println(
         "Can't find the class that goes with the object");
    }
  
Methods Summary
public static voidmain(java.lang.String[] args)

    JFrame f = new BackFromTheDead(  );
    f.pack(  );
    f.setVisible(true);