First Simple applet //WelcomeApplet java: Applet for displaying a message import javax. swing. *i public class WelcomeApplet extends JApplet I /* Initialize the applet * public void init() add (new JLabel(" Welcome to Java, JLabel center))i WelcomeApplet java: Applet for displaying a message import javax. swing. X public class WelcomeApplet extends JApplet i /*大工 ntia1 ize the applet*/ public WelcomeApplet () add (new jlabel(" Welcome to Java" jlabel center))i Liang, Introduction to Java Programming, Sixth Edition, (c)2005 Pearson Education, Inc. All rights reserved. 0-13-148952-6Liang, Introduction to Java Programming, Sixth Edition, (c) 2005 Pearson Education, Inc. All rights reserved. 0-13-148952-6 4 First Simple Applet // WelcomeApplet.java: Applet for displaying a message import javax.swing.*; public class WelcomeApplet extends JApplet { /** Initialize the applet */ public WelcomeApplet() { add(new JLabel("Welcome to Java", JLabel.CENTER)); } } // WelcomeApplet.java: Applet for displaying a message import javax.swing.*; public class WelcomeApplet extends JApplet { /** Initialize the applet */ public void init() { add(new JLabel("Welcome to Java", JLabel.CENTER)); } }