// Import is imported to import a class and file import a parent class and does not import his subclavilt java.applet. *; import java.awt. *; // Extends means inheriting parent class myapplet extends applet The 4 important function init () for initialization of various parameters and getParameter () functions is triggered when the page is displayed when the page is displayed when the page is displayed when the page is displayed. Stop (). () The web page is marked with the end of the applet life * /
Public void init () {} // Paint (Graphics G) This method is included in the AWT. * Public Void Paint (GRAPHICS G) {//g.drawstring (but InTxinTy); use this function output in the applet Strings x, y is the coordinate g.drawstring ("Hello", 20, 30);}; 1.Applet execution mechanism is different from the APLICATION, so there is no main () function 2.applet. AppletViewer myapplet.html This HTML file The production is as follows: Add the following code in the HTML file: