The moose likes Applets and the fly likes applet related confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Applets
Reply Bookmark "applet related confusion " Watch "applet related confusion " New topic
Author

applet related confusion

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 973

in the book its said that applet can be used in source code too,instead of writing it again ang again in HTML pages...

and the code was like follows

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

/*<APPLET
Code=applet4.class
WIDTH=200
HEIGHT=200>
</APPLET>
*/
public class applet4 extends Applet
{
public void paint(Graphics g)
{
g.drawString("Hello",60,100);
}
}

how how will this code used in any HTML page?


http://www.lifesbizzare.blogspot.com || OCJP:81%
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Moving to Applets.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 973

Rob Prime didnt get you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
It won't be used in any HTML page - it's for development and testing purposes only. If you embed the applet tag in the Java source code like his, then you can use appletviewer to run the applet by typing "appletviewer applet4.java". That's because appletviewer doesn't care about the rest of the file - it only looks for the applet tag.

If you want to deploy the applet for others to use, then you do need a proper HTML page (which would contain the same applet tag).


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: applet related confusion
 
Similar Threads
Answer :Run time error / why?
Applet
applet problem
applet in jar does not work
applet call to servlet (my http tunnel saga)