home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / enzykbad / everything / java / rotatorbox.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  1.3 KB  |  41 lines

  1. /*----------------------------------------------------------------------*/
  2. /*----------------------------------------------------------------------*/
  3. /*             Jim Morey  -  morey@math.ubc.ca  -  Mar 10,1996          */
  4. /*----------------------------------------------------------------------*/
  5.  
  6. import java.io.*;
  7. import java.applet.*;
  8. import java.awt.*;
  9. import java.net.*;
  10. import java.lang.*;
  11. import Rotator;
  12.  
  13. /*----------------------------------------------------------------------*/
  14. public class RotatorBox extends Applet {
  15.  
  16.   /* -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - */
  17.   public void init() {
  18.     setBackground(new Color(255,200,200));
  19.     Color foreground = Color.lightGray;
  20.     String config = getParameter("solid");
  21.     URL here = this.getDocumentBase();
  22.     try {
  23.       /* .. get solid info .. */
  24.       int H = 300;
  25.       int W = 300; 
  26.       InputStream is_solid = new URL(here,config).openStream();
  27.       Solid solid = new Solid(is_solid,W,H,10);
  28.       is_solid.close();
  29.       Rotator rotator= new Rotator(this,solid,W,H);
  30.       new Thread(rotator).start(); 
  31.       add("South",rotator);
  32.       is_solid.close();
  33.       show();
  34.     } catch (MalformedURLException e){
  35.       System.out.println("MalformedURLException --config!");
  36.     } catch (IOException e){
  37.       System.out.println("IOException --config!");
  38.     }
  39.   }
  40. }
  41.