Applet – Resize to Maximum Size

package AppletExamples; import java.applet.*; import java.awt.*; //import java.awt.Dimension; /** * * @author Kodingkeys */ public class Dimension extends Applet { public void paint(Graphics g) { this.resize(this.getMaximumSize()); } }

Applet- Counter

package AppletExamples; import java.applet.Applet; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; /** * * @author kodingkeys */ public class Prog2 extends Applet implements Runnable { int counter; Thread t; public void init(){ counter = 0; t = new Thread(this); t.start(); } public void run(){ try{ while(true){ repaint(); Thread.sleep(1000); ++counter; } } catch(Exception e){ }…

Applet – Hello World

package AppletExamples; import java.applet.Applet; import java.awt.Graphics; /** * * @author kodingkeys */ public class Prog1 extends Applet { public void init() { } public void paint(Graphics g){ //write text using drawString method of Graphics class g.drawString(“This is my First Applet”,20,100); } }