// An applet that reads a data file from the applet's WWW site.
// Barry Cornelius, 20 June 2000
import java.awt.    BorderLayout;
import java.io.     BufferedReader;
import java.awt.    Container;
import java.io.     InputStreamReader;
import java.io.     IOException;
import javax.swing. JApplet;
import javax.swing. JLabel;
import java.net.    URL;
public class ShapesJComponentApplet extends JApplet
{
   public void init()
   {
      try
      {
         final URL tURL = 
               new URL(getDocumentBase(), "ShapesJComponentProg.data");
         final BufferedReader tInputHandle =
               new BufferedReader(new InputStreamReader(tURL.openStream()));
         final ShapesJComponent tShapesJComponent = 
               new ShapesJComponent(tInputHandle);
         final Container tContentPane = getContentPane();
         tContentPane.add(new JLabel("NORTH"), BorderLayout.NORTH);
         tContentPane.add(tShapesJComponent,   BorderLayout.CENTER);
         tContentPane.add(new JLabel("SOUTH"), BorderLayout.SOUTH);
      }
      catch(final IOException pIOException)
      {
         throw new IllegalArgumentException();
      }
   }
}
