0

hi,
how do you get the html file to run the java applet in a webbrowser.
I need to have a html file which will allow me to view this applet in a web browser.
im using eclipse to write the code for the applet.

import java.awt.Graphics;
import javax.swing.JApplet;

@SuppressWarnings("serial")
public class Sticky extends JApplet
{
	
	public void paint(Graphics g)
	{
		super.paint(g);
		
		g.drawOval(50, 50, 50, 50); //head
		g.drawOval(63, 60, 10, 10);   //eye 1
		g.drawOval(63, 60, 5, 5);   //eye 1
		g.fillOval(63, 60, 5, 5);   //eye 1
		g.drawOval(83, 60, 5, 5);   // eye 2
		g.fillOval(83, 60, 5, 5);    //colour
		g.drawOval(83, 60, 10, 10);  // eye 2
		g.drawOval(70, 85, 10, 7);  // mouth
		g.drawLine(75, 100, 75, 155); // body
		g.drawLine(75, 155, 95, 200);  // leg1
		g.drawLine(75, 155, 55, 200);   //leg2
		g.drawLine(75, 110, 100, 130);  // upper arm right
		g.drawLine(100, 130, 75, 150);  //lower arm right
		g.drawLine(75, 110, 50, 100); //upper arm left
		g.drawLine(50, 100, 35, 85);   //lower arm left
		g.drawLine(48, 50, 102, 50);   // hat brim
		g.drawRect(60, 10, 30, 40);    // hat main
		g.drawRect(60, 30, 30, 10);    // hat small rect
		
		
	}

}
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by Taywin
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.