FileDocCategorySizeDatePackage
BackFromTheDead.javaAPI DocExample949Sat Apr 23 22:35:40 BST 2005None

BackFromTheDead

public class BackFromTheDead extends JFrame

Fields Summary
Constructors Summary
public BackFromTheDead(String name)

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

			if ( Beans.isInstanceOf(bean, JComponent.class) ) { 
				JComponent comp = (JComponent)
					Beans.getInstanceOf( bean, JComponent.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 frame = new BackFromTheDead( args[0] );
		frame.pack();
		//frame.setSize(300,300);
		frame.setVisible(true);