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:
- Write your java applet code in a text editor and save it as YourClassName.java ( eg. MyAppet.java for this program)
- 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)
- To compile use ‘javac YourClassName.java’
- To Run use 'appletviewer YourClassName.html'