import java.applet.Applet;
import java.awt.Graphics;
import java.net.URL;
import java.net.MalformedURLException;

public class HWAURLForward extends Applet {
	public void paint(Graphics g) {

		g.drawString( 	getParameter("displayText"),
							Integer.parseInt(getParameter("xPos")),
							Integer.parseInt(getParameter("yPos")) );
		try {
			Thread.sleep(5000); //five seconds delay
		} catch (InterruptedException iee) {
			System.out.println("an InterrupedException occurred");
		} //catch

		try {
			(this.getAppletContext()).showDocument( new URL(getParameter("URL")) );
		} catch (MalformedURLException murle) {
			System.out.println("illegal URL");
		} //catch
	} //paint()
	public String getAppletInfo() {
		return( "written by Mario Jeckle\nversion: 1.1\nCopyright (c) by Mario Jeckle");
	} //getAppletInfo()
	public String[][] getParameterInfo() {
		String appInfo[][] = {
	 		{"displayText", "anyString", "string to display"},
	 		{"xPos", "numeric value" , "horizontal position"},
	 		{"yPos", "numeric value", "vertical position"},
	 		{"URL", "any valid URL according to IETF's RFC 1738", "URL to jump to"}
 		};

		return appInfo;
	} //getParameterInfo()
} //class HWAURLForward 