home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 14 / IOPROG_14.ISO / soft / sdkjava / dxma.exe / DXMA05.cab / samples / da / java / exercises / hello / Hello.java next >
Encoding:
Java Source  |  1997-11-13  |  1.0 KB  |  32 lines

  1. //
  2. // This applet illustrates a simple hello world example,
  3. // it displays a hello message on a blue background.
  4. //
  5. // Copyright (c) 1997 Microsoft Corporation
  6.  
  7. import com.ms.dxmedia.*;
  8.  
  9. // This class extends the DXMApplet class.  The model you set in this class,
  10. // by calling the setModel() method, is the model that will be displayed.
  11. public class Hello extends DXMApplet {
  12.   public void init() {
  13.     super.init() ;
  14.     setModel(new HelloModel());
  15.   }
  16. }
  17.  
  18. // This class extends the Model class.  The createModel method in this class
  19. // is where you construct your animation.
  20. class HelloModel extends Model {
  21.  
  22.   // We'll just display a hello message over a solid blue background.
  23.   public void createModel(BvrsToRun blist)
  24.   {
  25.     FontStyleBvr fs = defaultFont.color(black);
  26.     ImageBvr helloImg = stringImage(toBvr("Hello, World"), fs);
  27.     ImageBvr backImg = solidColorImage(blue);
  28.     // setImage() sets the image that actually gets displayed 
  29.     setImage(overlay(helloImg, backImg));
  30.   }
  31. }
  32.