// This example is from the book Developing Java Beans by Robert Englander.
// Copyright (c) 1997 O'Reilly & Associates.
// You may study, use, modify, and distribute this example for any purpose.
// This example is provided WITHOUT WARRANTY either expressed or implied.
// Chapter 5 -- The SimpleReader class
import java.applet.*;
import java.awt.*;
import java.io.*;
public class SimpleReader extends Applet
{
public void init()
{
try
{
FileInputStream f = new FileInputStream("Saver.tmp");
ObjectInput s = new ObjectInputStream(f);
Button b =(Button)s.readObject();
add(b);
}
catch (Exception e)
{
System.out.println(e);
}
}
}
|