home *** CD-ROM | disk | FTP | other *** search
/ Learn Java Now / Learn_Java_Now_Microsoft_1996.iso / JavaNow / Code / Chap12 / HelloAuto / HelloAuto.java < prev    next >
Encoding:
Java Source  |  1996-06-17  |  2.8 KB  |  85 lines

  1. //******************************************************************************
  2. // HelloAuto.java:    Applet
  3. //
  4. //******************************************************************************
  5. import java.applet.*;
  6. import java.awt.*;
  7.  
  8. //==============================================================================
  9. // Main Class for applet HelloAuto
  10. //
  11. //==============================================================================
  12. public class HelloAuto extends Applet
  13. {
  14.  
  15.     // HelloAuto Class Constructor
  16.     //--------------------------------------------------------------------------
  17.     public HelloAuto()
  18.     {
  19.         // TODO: Add Constructor code here
  20.     }
  21.  
  22.     // APPLET INFO SUPPORT:
  23.     //        The getAppletInfo() method returns a string describing the applet's 
  24.     // author, copyright date, or miscellaneous information.
  25.     //--------------------------------------------------------------------------
  26.     public String getAppletInfo()
  27.     {
  28.         return "Name: HelloAuto\r\n" +
  29.                "Author: Stephen R. Davis\r\n" +
  30.                "Created for Learn Java Now (c)";
  31.     }
  32.  
  33.  
  34.     // The init() method is called by the AWT when an applet is first loaded or 
  35.     // reloaded.  Override this method to perform whatever initialization your 
  36.     // applet needs, such as initializing data structures, loading images or 
  37.     // fonts, creating frame windows, setting the layout manager, or adding UI 
  38.     // components.
  39.     //--------------------------------------------------------------------------
  40.     public void init()
  41.     {
  42.         resize(320, 240);
  43.  
  44.         // TODO: Place Addition Initialization code here
  45.     }
  46.  
  47.     // Place additional applet clean up code here.  destroy() is called when 
  48.     // when you applet is terminating and being unloaded.
  49.     //-------------------------------------------------------------------------
  50.     public void destroy()
  51.     {
  52.         // TODO: Place applet cleanup code here
  53.     }
  54.  
  55.     // HelloAuto Paint Handler
  56.     //--------------------------------------------------------------------------
  57.     public void paint(Graphics g)
  58.     {
  59.         g.drawString("Hello, world", 0, 20);
  60.     }
  61.  
  62.     //        The start() method is called when the page containing the applet 
  63.     // first appears on the screen. The AppletWizard's initial implementation 
  64.     // of this method starts execution of the applet's thread.
  65.     //--------------------------------------------------------------------------
  66.     public void start()
  67.     {
  68.         // TODO: Place additional applet Start code here
  69.     }
  70.     
  71.     //        The stop() method is called when the page containing the applet is 
  72.     // no longer on the screen. The AppletWizard's initial implementation of 
  73.     // this method stops execution of the applet's thread.
  74.     //--------------------------------------------------------------------------
  75.     public void stop()
  76.     {
  77.     }
  78.  
  79.  
  80.  
  81.  
  82.     // TODO: Place additional applet Code here
  83.  
  84. }
  85.