• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

applet related confusion

 
Ranch Hand
Posts: 1087
Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Applets.
 
Vishal Hegde
Ranch Hand
Posts: 1087
Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob Prime didnt get you
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic