Thursday, March 21, 2013

How To Run a Java Applet

          To run a Java Applet using command prompt, we need to   create a HTML file and link it to our applet.

To do so, follow these steps:

  1. Write your java applet code in a text editor and save it as YourClassName.java ( eg. MyAppet.java for this program)
  2. Write the following html code in a text editor, replace the YourClassName.class with the name of your class and save it as YourClassName.html (eg. MyApplet.html for this program
  3. To compile use ‘javac YourClassName.java’
  4. To Run use 'appletviewer YourClassName.html'

   You can also refer from Link

No comments:

Post a Comment