package com.radinks.tests; import java.awt.*; import java.awt.event.*; import javax.swing.JApplet; import java.net.*; import java.security.*; /** *

Title: UnsignedApplet

*

Description: Demo of an Unsigned applet's unsuccessfull attempt to retrieve * an image stored on a remote server

*

Copyright: Copyright (c) 2003 Raditha Dissanayake

*

Company: Raditha Dissanayake

* @author Raditha Dissanayake * @version 1.0 */ public class UnsignedApplet extends JApplet { Image img; public UnsignedApplet() { this.setSize(200,200); } public void init() { try { /* * create the url that references an image stored on a remote server */ URL u = new URL("http://radinks.com/images/drop-logo100.jpg"); img = getToolkit().createImage(u); } catch (Exception ex) { ex.printStackTrace(); } } public void paint(Graphics g) { try { g.drawImage(img,10,10,50,50,this); } catch (Exception ex) { g.drawString("image could not be loaded",10,50); } } }