home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / samples.z / Threads.wxc < prev    next >
Text File  |  1996-12-10  |  3KB  |  143 lines

  1. Save Format v1.3
  2. @begin ClassFile "Threads"
  3.  Exported 1;
  4.  Abstract 0;
  5.  Interface 0;
  6.  PackageName "";
  7.  Language "Java";
  8.  
  9.  @begin UserFunction "Threads()"
  10.   Compiler 1;
  11.   GencodeFunction 1;
  12.   GencodeSrcLine 10;
  13.   FunctionName "Threads::Threads()";
  14.  @end;
  15.  
  16.  @begin UserFunction "init()"
  17.   Compiler 1;
  18.   GencodeSrcLine 14;
  19.   FunctionName "Threads::init()";
  20.  @end;
  21.  
  22.  @begin UserFunction "CreateAppletForm()"
  23.   Compiler 1;
  24.   GencodeFunction 1;
  25.   GencodeSrcLine 30;
  26.   FunctionName "Threads::CreateAppletForm()";
  27.  @end;
  28.  
  29.  @begin UserFunction "main(String args[])"
  30.   Compiler 1;
  31.   GencodeFunction 1;
  32.   GencodeSrcLine 35;
  33.   FunctionName "Threads::main(String args[])";
  34.  @end;
  35.  
  36.  @begin UserFunction "createAppletForm()"
  37.   Compiler 1;
  38.   GencodeFunction 1;
  39.   GencodeSrcLine 51;
  40.   FunctionName "Threads::createAppletForm()";
  41.  @end;
  42.  
  43.  @begin HPPPrefixBlock
  44. @begin-code HPPPrefix
  45.  
  46. // add your custom import statements here
  47.  
  48. @end-code;
  49.   GencodeSrcLine 6;
  50.  @end;
  51.  
  52.  @begin ClassContentsBlock
  53. @begin-code ClassContents
  54.  
  55.     // add your data members here
  56.  
  57. @end-code;
  58.   GencodeSrcLine 56;
  59.  @end;
  60.  
  61. @begin-code BaseClassList
  62.  
  63. extends powersoft.jcm.ui.AWTAppletEx
  64.  
  65. @end-code;
  66.  
  67. @begin-code GeneratedClassContents
  68.  
  69.  
  70. @end-code;
  71.  
  72. @begin-code Code "Threads::Threads()"
  73.  
  74.     public @CLASSNAME@()
  75.     {
  76.         super();
  77.     }
  78.  
  79. @end-code;
  80.  
  81. @begin-code Code "Threads::init()"
  82.  
  83. /*
  84.  * @CLASSNAME@.java
  85.  *
  86.  * Copyright 1996 Sybase, Inc. All rights reserved.
  87.  *
  88.  *
  89.  * This sample program demonstrates the use of multiple
  90.  * threads of execution in java.
  91.  */
  92.  
  93.     public void init()
  94.     //********************************
  95.     {
  96.         super.init();
  97.         CreateAppletForm();
  98.     }
  99.  
  100. @end-code;
  101.  
  102. @begin-code Code "Threads::CreateAppletForm()"
  103.  
  104.     public void CreateAppletForm()
  105.     {
  106.         Form1 form = new Form1(this);
  107.         form.create();
  108.     }
  109.  
  110. @end-code;
  111.  
  112. @begin-code Code "Threads::main(String args[])"
  113.  
  114.     public static void main(String args[])
  115.     {
  116.         @@CLASSNAME@ applet = new @CLASSNAME@();
  117.         powersoft.jcm.ui.Form f = new powersoft.jcm.ui.Form();
  118.         f.create();
  119.         f.setMainWindow(true);
  120.         f.addComponent(applet);
  121.         applet.init();
  122.         java.awt.Insets insets = f.getInsets();
  123.         java.awt.Dimension size = applet.size();
  124.         applet.move( insets.left, insets.top );
  125.         f.setWidth( size.width + insets.left + insets.right );
  126.         f.setHeight( size.height + insets.top + insets.bottom );
  127.         f.resize(applet.preferredSize());
  128.         f.setVisible(true);
  129.     }
  130.  
  131. @end-code;
  132.  
  133. @begin-code Code "Threads::createAppletForm()"
  134.  
  135.     public void createAppletForm()
  136.     {
  137.         Form1 form = new Form1(this);
  138.         form.create();
  139.     }
  140.  
  141. @end-code;
  142. @end;
  143.