0

well am facing a problem in executing my java applet in the web browser this is my very simple code

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


public class SimpleApplet extends Applet {
    public void paint(Graphics g){
        g.drawString("A Simple Applet", 20, 20);
}

}

am reading a book that says, i have to create an html file and put the tag on it. I did put when i click it is doesn't work

this is the tag

applet code=”SimpleApplet” width=200 height=60>
  applet>

am i using the tag wrongly? can anyone guid me please? it feels like small think yet i couldn't solve it -_-

mazin
  • 234
  • 1
  • 3
  • 13
  • 1
    possible duplicate of [how to run a java applet in web browser](http://stackoverflow.com/questions/9921268/how-to-run-a-java-applet-in-web-browser) – mschenk74 Feb 26 '15 at 13:39
  • 1) Why code an applet? If it is due to the teacher specifying it, please refer them to [Why CS teachers should **stop** teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). 2) Why use AWT? See [this answer](http://stackoverflow.com/questions/6255106/java-gui-listeners-without-awt/6255978#6255978) for many good reasons to abandon AWT using components in favor of Swing. .. – Andrew Thompson Feb 27 '15 at 01:47
  • .. 3) Words typed in all lower case are hard to read, like trying to listen to someone who is mumbling. Please use an upper case letter at the start of sentences, for the word I, and proper names like `ArrayList` or Oracle. – Andrew Thompson Feb 27 '15 at 01:47

0 Answers0