home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 July & August / Pcwk78a98.iso / Micrsoft / SAMPLES / VJ6SAMPL.EXE / EyeControl / Form1.java < prev   
Text File  |  1998-02-24  |  5KB  |  151 lines

  1.  
  2. /*  Copyright (C) Microsoft Corporation, 1996-1998.  All rights reserved.
  3.  
  4.   This source code is intended only as a supplement to Microsoft
  5.   Visual J++ 6.0.  See this product's on-line documentation for detailed   
  6. information regarding Microsoft code samples.
  7.  
  8. */
  9.  
  10. // Form1.java
  11.  
  12. import wfc.app.*;
  13. import wfc.core.*;
  14. import wfc.ui.*;
  15.  
  16. /**
  17.  * This class can take a variable number of parameters on the command
  18.  * line. Program execution begins with the main() method. The class
  19.  * constructor is not invoked unless an object of type 'Form1'
  20.  * created in the main() method.
  21.  */
  22. public class Form1 extends Form
  23. {
  24.   /**
  25.    * Creates a Form1 object.
  26.    */
  27.   public Form1()
  28.   {
  29.     // Required for Visual J++ Form Designer support
  30.     initForm();   
  31.   }
  32.  
  33.   /**
  34.    * The main entry point for the application. 
  35.    *
  36.    * @param args Array of parameters passed to the application via the command line.
  37.    */
  38.   public static void main(String args[])
  39.   {
  40.     Application.run(new Form1());
  41.   }
  42.  
  43.  
  44.   /**
  45.    * NOTE: The following code is required by the Visual J++ form
  46.    * designer.  It can be modified using the form editor.  Do not
  47.    * modify it using the code editor.
  48.    */
  49.  
  50.   Container components = new Container();
  51.   EyeControl eyeControl1 = new EyeControl();
  52.   EyeControl eyeControl2 = new EyeControl();
  53.   EyeControl eyeControl3 = new EyeControl();
  54.   EyeControl eyeControl4 = new EyeControl();
  55.   EyeControl eyeControl5 = new EyeControl();
  56.   EyeControl eyeControl6 = new EyeControl();
  57.   EyeControl eyeControl7 = new EyeControl();
  58.   EyeControl eyeControl8 = new EyeControl();
  59.   EyeControl eyeControl9 = new EyeControl();
  60.   EyeControl eyeControl10 = new EyeControl();
  61.   Button button1 = new Button();
  62.  
  63.   private void initForm()
  64.   {
  65.  
  66.     this.setBackColor(Color.CONTROL);
  67.     this.setSize(new Point(386, 255));
  68.     this.setTabIndex(-1);
  69.     this.setTabStop(true);
  70.     this.setText("Form1");
  71.     this.setAutoScaleBaseSize(16);
  72.     this.setClientSize(new Point(378, 228));
  73.     eyeControl1.setLocation(new Point(10, 10));
  74.     eyeControl1.setSize(new Point(70, 70));
  75.     eyeControl1.setTabIndex(1);
  76.     eyeControl1.setTabStop(true);
  77.     eyeControl1.setText("eyeControl1");
  78.     eyeControl1.setIrisColor(Color.BLACK);
  79.     eyeControl2.setLocation(new Point(80, 10));
  80.     eyeControl2.setSize(new Point(70, 70));
  81.     eyeControl2.setTabIndex(2);
  82.     eyeControl2.setTabStop(true);
  83.     eyeControl2.setText("eyeControl2");
  84.     eyeControl2.setIrisColor(Color.DARKGRAY);
  85.     eyeControl3.setLocation(new Point(150, 10));
  86.     eyeControl3.setSize(new Point(70, 70));
  87.     eyeControl3.setTabIndex(3);
  88.     eyeControl3.setTabStop(true);
  89.     eyeControl3.setText("eyeControl3");
  90.     eyeControl3.setIrisColor(Color.GRAY);
  91.     eyeControl4.setLocation(new Point(10, 80));
  92.     eyeControl4.setSize(new Point(70, 70));
  93.     eyeControl4.setTabIndex(4);
  94.     eyeControl4.setTabStop(true);
  95.     eyeControl4.setText("eyeControl4");
  96.     eyeControl4.setIrisColor(Color.LIGHTGRAY);
  97.     eyeControl5.setLocation(new Point(80, 80));
  98.     eyeControl5.setSize(new Point(70, 70));
  99.     eyeControl5.setTabIndex(5);
  100.     eyeControl5.setTabStop(true);
  101.     eyeControl5.setText("eyeControl5");
  102.     eyeControl5.setIrisColor(Color.WHITE);
  103.     eyeControl6.setLocation(new Point(150, 80));
  104.     eyeControl6.setSize(new Point(70, 70));
  105.     eyeControl6.setTabIndex(6);
  106.     eyeControl6.setTabStop(true);
  107.     eyeControl6.setText("eyeControl6");
  108.     eyeControl6.setIrisColor(Color.RED);
  109.     eyeControl7.setLocation(new Point(10, 150));
  110.     eyeControl7.setSize(new Point(70, 70));
  111.     eyeControl7.setTabIndex(7);
  112.     eyeControl7.setTabStop(true);
  113.     eyeControl7.setText("eyeControl7");
  114.     eyeControl7.setIrisColor(Color.GREEN);
  115.     eyeControl8.setLocation(new Point(80, 150));
  116.     eyeControl8.setSize(new Point(70, 70));
  117.     eyeControl8.setTabIndex(8);
  118.     eyeControl8.setTabStop(true);
  119.     eyeControl8.setText("eyeControl8");
  120.     eyeControl9.setLocation(new Point(150, 150));
  121.     eyeControl9.setSize(new Point(70, 70));
  122.     eyeControl9.setTabIndex(9);
  123.     eyeControl9.setTabStop(true);
  124.     eyeControl9.setText("eyeControl9");
  125.     eyeControl9.setIrisColor(new Color(255, 255, 0));
  126.     eyeControl10.setLocation(new Point(250, 20));
  127.     eyeControl10.setSize(new Point(120, 140));
  128.     eyeControl10.setTabIndex(10);
  129.     eyeControl10.setTabStop(true);
  130.     eyeControl10.setText("eyeControl10");
  131.     eyeControl10.setIrisColor(new Color(0, 0, 128));
  132.     button1.setLocation(new Point(270, 170));
  133.     button1.setSize(new Point(80, 30));
  134.     button1.setTabIndex(11);
  135.     button1.setTabStop(true);
  136.     button1.setText("button1");
  137.     this.setNewControls(new Control[] {
  138.                         button1, 
  139.                         eyeControl10, 
  140.                         eyeControl9, 
  141.                         eyeControl8, 
  142.                         eyeControl7, 
  143.                         eyeControl6, 
  144.                         eyeControl5, 
  145.                         eyeControl4, 
  146.                         eyeControl3, 
  147.                         eyeControl2, 
  148.                         eyeControl1});
  149.   }
  150.   // NOTE: End of form designer support code
  151. }