








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!









07/20/24 1
07/20/
An application is a standalone program that can be invoked from the command line. An applet is a program that runs in the context of a browser session. A servlet is a program that is invoked on a server program, and it runs in the context of a web server process.
07/20/
< a pple t c o de = H e llo W o r ld. c la s s < /a pple t >
H e llo W o r ld. c la s s s e r ve r h o s t we b s e r v e r m y W e bP a g e. h t m l b r o w s e r h o s t bro ws e r re qe u s t f o r m y W e bP a g e. h t m l m y W e bP a g e. h t m l r e qu e s t f o r H e llo W o rldcla s s H e llo W o r ld. c la s s H e llo W o r ld. cla s s
07/20/
An applet program is a written as a subclass of the java.Applet class or the javax.swing.Japplet class. There is no main() method in an Applet. An applet uses AWT for graphics, or JApplet, a subclass of javax.swing.
07/20/
07/20/ Applet Security
Ref: http://java.sun.com/docs/books/tutorial/deployment/applet/index.html/
07/20/
< PARAM NAME ="imageSource" VALUE ="images/Beans"> < PARAM NAME ="backgroundColor" VALUE ="0xc0c0c0"> < PARAM NAME ="endImage" VALUE =10>
07/20/
// applet to display a message in a window import java.awt.; import java.applet.; public class hello extends Applet { public void init( ) { setBackground(Color.yellow); } // end of init() public void paint(Graphics g) { final int FONT_SIZE = 42; Font font = new Font("Serif", Font.BOLD, FONT_SIZE); // set font, and color and display message // on the screen at position 250, g.setFont(font); g.setColor(Color.blue); // The message in the next line is the one // you will see g.drawString("Hello, world!",250,150); } // end of paint() } // end of hello
07/20/
A proxy server (Y) can be used to circumvent the security constraints. S e r ve r h o s t C l i e n t h o s t H TTP s e r v e r bro ws e r a pple t H o s t X a p p le t d o w n lo a d c o n n e c tio n r e q u e s t s e r v e r Y s e r v e r Z c o n n e c tio n r e q u e s t
07/20/
An applet is a Java class Its code is downloaded from a web server It runs in the browser’s environment on the client host It is invoked by a browser when it scans a web page and encounters a class specified with the APPLET tag For security reason, the execution of an applet is normally subject to restrictions: applets cannot access files in the file system on the client host Applets cannot make network connection exception to the server host from which it originated