Studyon Minte9.com
Applets




Hello World



// FirstApplet.java

import java.applet.*;
import java.awt.*;

public class FirstApplet extends Applet{
  public void paint(Graphics g){
    g.drawString("Welcome in Java Applet.",40,20);
  }
}

// test.html

<HTML>
<HEAD></HEAD>
<BODY>
<APPLET ALIGN="CENTER" CODE="FirstApplet.class" WIDTH="800" HEIGHT="500"></APPLET>
</BODY>
</HTML>


// test2.html

<applet MAYSCRIPT="true" height="80" width="95" name="DP4WEB" 
                archive="DP4Web.jar" code="com.blabla.DP4WEB" id="DP4WEB"> 
	<param name="a" value="1" /> 
	Java(tm) is not installed in this machine. 
</applet>


---------------------


Netbeans Applet

1) File > New Project (Ctrl-Shift-N). Under Categories, select Java

2) Right-click the HelloApplet project node in the Projects window and select New > Other (Ctrl-N).
	Under Categories, select Java. Under File Types, select Applet.
	Alternatively, if you want to visually design your applet, select Swing GUI Forms > JApplet Form.

3) Under Class Name, type MyApplet.

4) MyApplet.java
	
	package firstapplet2;

	import java.applet.Applet;
	import java.awt.Graphics;

	public class MyApplet extends Applet {
		@Override
		public void paint(Graphics g) {
			g.drawString("Hello applet!", 50, 25);
		}
	}

5) Build and run project

	The MyApplet.html launcher file, with the applet embedded, is created in the build folder, 
	which you can see if you switch to the Files window.


http://docs.oracle.com/javase/tutorial/deployment/applet/getStarted.html
http://netbeans.org/kb/docs/web/applets.html
http://stackoverflow.com/questions/2604034/starting-java-applet-directly-from-jar-file