//******************************************************************** // Class Name: HelloApplet // Assignment: Lab #2, The (in)famous Hello World program as an Applet // // Author Name: Your Name REPLACE with YOUR info // Email: youremail@calpoly.edu and ADD your name to // URL: www.calpoly.edu/~yourlogin/ the HISTORY below if // UNIX home: /home/yourpath/yourhomedir you make any CHANGES. // // Course: CSC/CPE 101 ALSO update these // Section: Prof Scheftic's lines with your // Term: ongoing own specific information // School: California Polytechnic State University // Address: San Luis Obispo, CA 93407 USA // // History: // A long time ago original version by an unknown author // 3/20/2000 prepared for CSC 101, M. Liu // 1/14/2001 modified for CSC/CPE-101, C. Scheftic: // expanded documentation to fit course template // //******************************************************************** // // Program Description and Design Overview: // This applet generates the proverbial programmer's test message: // "Hello World!" // // Input Requirements: // None. // // Output Requirements: // First line: blank line // Second line: Hello, world! // Third line: blank line // // Variables Used: // None. // // Imported Classes: // java.applet.* // java.awt.* // // Included Methods: // paint(Graphics) // // Imported Methods: // drawString(String str, int x, int y) // // Program Assumptions: // None. // // Pending Problems: // None known as of 14 Jan 2001. // //******************************************************************** import java.applet.*; import java.awt.*; public class HelloApplet extends Applet { public void paint(Graphics g) { g.drawString("Hello, world!", 150, 150); } // end paint } // end HelloApplet