aspose file tools*
The moose likes Applets and the fly likes applet related confusion Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "applet related confusion " Watch "applet related confusion " New topic
Author

applet related confusion

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1050

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: 19541
    
  16

Moving to Applets.


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

Joined: Aug 01, 2009
Posts: 1050

Rob Prime didnt get you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
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).


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: applet related confusion
 
Similar Threads
applet problem
applet call to servlet (my http tunnel saga)
Applet
Answer :Run time error / why?
applet in jar does not work