Chapter 3 (Web hosting directory) Introduction to Java Applets 113 Click

Chapter 3 Introduction to Java Applets 113 Click a tab to select a two-dimensional graphics demo. Try changing the options to see their effect on the demonstration. Fig. 3.5Sample execution of applet Java2D. Fig. 1 // Fig. 3.6: WelcomeApplet.java 2 // A first applet in Java. 3 4 // Java core packages 5 import java.awt.Graphics; // import class Graphics 6 7 // Java extension packages 8 import javax.swing.JApplet; // import class JApplet 9 10 public class WelcomeApplet extends JApplet { 11 12 // draw text on applet s background 13 public void paint( Graphics g ) 14 { 15 // call inherited version of method paint 16 super.paint( g ); Fig. 3.6A first applet in Java and the applet s screen output (part 1 of 2). Fig. 3. Copyright 1992 2002 by Deitel & Associates, Inc. All Rights Reserved. 7/2/01

Leave a Reply