home *** CD-ROM | disk | FTP | other *** search
/ Chip Special: HTML & Java / Chip-Special_1997-01_HTML-a-Java.bin / javasdk / sdk-java.exe / SDKJava.cab / Samples / directX / dDraw / ddex3 / TestGraph.java < prev    next >
Encoding:
Java Source  |  1996-10-10  |  1.2 KB  |  59 lines

  1. import java.awt.*;
  2. import java.awt.peer.ComponentPeer;
  3. import java.applet.*;
  4. import com.ms.com.*;
  5. import com.ms.awt.*;
  6. import com.ms.awt.peer.*;
  7. import com.ms.directX.*;
  8.  
  9. public class TestGraph extends Applet
  10. {
  11.     Flick         s;
  12.     FlickSurface f = null;
  13.     
  14.     
  15.     ////////////////////////////////////////////////////////////////////////////
  16.  
  17.     public static void main(String args[])
  18.     {
  19.         TestGraphFrame frame = new TestGraphFrame("DirectX sample");
  20.  
  21.         //----------------------------------------------------------------------
  22.         // Must show Frame before we size it so insets() will return valid values
  23.         frame.show();
  24.         frame.hide();
  25.         frame.resize(640,480);
  26.  
  27.         TestGraph applet = new TestGraph();
  28.  
  29.         frame.add("Center", applet);
  30.         applet.init();
  31.         applet.start();
  32.         frame.show();
  33.     }
  34.  
  35.     //////////////////////////////////////////////////////////////////////////
  36.     //
  37.     // init
  38.     //
  39.     public void init()
  40.     {
  41.         s    = new Flick();
  42.         
  43.         setLayout(new GridLayout(1, 1, 0, 0));
  44.         add(s);
  45.         s.addNotify();
  46.         s.resize(640,480);
  47.         s.show();        
  48.  
  49.         f = s.doInit();
  50.         if( f != null )
  51.             f.start();
  52.     }
  53.     
  54.     //////////////////////////////////////////////////////////////////////////
  55.     
  56.     
  57.     
  58. }
  59.