-
Hi friends. Can any one tell me how to execute an applet program.0
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a
member of our community. Consider creating an
account or login.
Replies
-
Administrator • Feb 5, 2009
Re: How to exicute an applet program written in java
You'll have to embed it in HTML. Do you know how to do that?rama_krish627Hi friends. Can any one tell me how to execute an applet program.Are you sure? This action cannot be undone. -
Member • Feb 5, 2009
Re: How to exicute an applet program written in java
Hi rama_krisharama_krish627Hi friends. Can any one tell me how to execute an applet program.
Applets can be executed in 2 ways:
1. Executing the applet within a java-compatible web browser.
For this write html code that has APPLET tag.
<applet code="[your java file name]" width=200 height=200> </applet>
Now simply run this file as a normal html file.
2. Using an applet viewer. Applet viewer executes your applet in a window. This is fastest and easiest way to test your applet.
In this make a separate file AppletHtml.html of same code as above.
<applet code="[your java file name]" width=200 height=200> </applet>
Then run above file as following command:
C:\>appletviewer AppletHtml.html
3. Better is one more way which is more commonly use - Simply include a comment at the head of you Java file/program
/* <applet code="[your java file name]" width=200 height=200> </applet> */
Then execute the appletviewer as told in point no2.
Hope I am correct and can be helpful .Others can correct me. 😀Are you sure? This action cannot be undone. -
Member • Feb 6, 2009
Re: How to exicute an applet program written in java
ya it's working. but the last one is not working.Are you sure? This action cannot be undone. -
Member • Feb 6, 2009
Re: How to exicute an applet program written in java
Hi rama_krish,rama_krish627ya it's working. but the last one is not working.
What is not working? What steps you followed to do so. Better share your program here if you have no issues with it. 😀Are you sure? This action cannot be undone. -
Member • Aug 21, 2009
Re: How to exicute an applet program written in java
Hi rama_krish627,
To make the last case working, you need to follow following three steps
Step # 1: Edit your Java source file.Add following lines of code in your java class file
/* <applet code="[your java file name]" width=200 height=200> </applet> */
Step # 2: Compile your program
Step # 3: Execute the appletviewer , specifying the name of your applet's source file. For eg., if your applet's source file(or your java program only) is in folder I:\JavaSrcCode then open command prompt ->switch to the location of your java(or applet ) source file-> type following command at it
I:\JavaSrcCode>appletviewer MyFirstApplet.java
Are you sure? This action cannot be undone.