1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
/* Get Applet Info Example This java example shows how get applet information using getAppletInfo method of an Applet class. */ /* <applet code="GetAppletInfoExample" width=400 height=200> </applet> */ import java.applet.Applet; import java.awt.Graphics; public class GetAppletInfoExample extends Applet{ public void paint(Graphics g){ String info = getAppletInfo(); g.drawString(info,50,50); } /* * Applet class provides default implementation of getAppletInfo() * method which returns null. * * Your Applet class should override this method to provide useful * information like applet name,author name and copyright information. */ public String getAppletInfo(){ String info = ""; info = info + "GetAppletInfoExample"; info = info + "@java-examples.com"; return info; } } |
Example Output
Add Comment