07-Applets-and-Graphics

07-Applets-and-Graphics - 2006 Marty Hall Applets and Basic...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
2 JSP, Servlet, Struts, JSF & Java 5 Training: http://courses.coreservlets.com © 2006 Marty Hall Applets and Basic Graphics 3 JSP, Servlet, Struts, JSF & Java 5 Training: http://courses.coreservlets.com © 2006 Marty Hall For live Java training, please see training courses at http://courses.coreservlets.com/. Servlets, JSP, Struts, JSF, AJAX, Java 5, etc. Taught by the author of Core Servlets and JSP , More Servlets and JSP , and this tutorial. Available at public venues, or customized versions can be held on-site at your organization.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 J2EE training: http://courses.coreservlets.com Agenda Applet restrictions Basic applet and HTML template The applet life-cycle Customizing applets through HTML parameters Methods available for graphical operations Loading and drawing images Controlling image loading Java Plug-In and HTML converter 5 J2EE training: http://courses.coreservlets.com Security Restrictions: Applets Cannot… Read from the local (client) disk Applets cannot read arbitrary files They can, however, instruct the browser to display pages that are generally accessible on the Web, which might include some local files Write to the local (client) disk The browser may choose to cache certain files, including some loaded by applets, but this choice is not under direct control of the applet Open network connections other than to the server from which the applet was loaded This restriction prevents applets from browsing behind network firewalls
Background image of page 2
6 J2EE training: http://courses.coreservlets.com Applets Cannot… Link to client-side C code or call programs installed on the browser machine Ordinary Java applications can invoke locally installed programs (Runtime.exec or ProcessBuilder.start) as well as link to local C/C++ modules (“native” methods) These actions are prohibited in applets because there is no way to determine whether the operations these local programs perform are safe Discover private information about the user Applets should not be able to discover the username of the person running them or specific system information such as current users, directory names or listings, system software, and so forth However, applets can determine the name of the host they are on; this information is already reported to the HTTP server that delivered the applet 7 J2EE training: http://courses.coreservlets.com Applet Template import java.applet.Applet; import java.awt.*; public class AppletTemplate extends Applet { // Variable declarations. public void init () { // Variable initializations, image loading, etc. } public void paint (Graphics g) { // Drawing operations. } } If you use JDK 1.4 or earlier, go to Java Plugin in Control Panel and disable applet caching. Otherwise, you sometimes have to restart browser when you modify
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/16/2009 for the course CSCI 571 taught by Professor Papa during the Summer '07 term at USC.

Page1 / 21

07-Applets-and-Graphics - 2006 Marty Hall Applets and Basic...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online