Hi Daniel,
Thanks for your response!
Fowllowing is my applet source: If the image from the same domain as the applet, it works. If not, no error on image. Would you mind tell why? Thanks again.
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.JApplet;
import java.net.*;
public class Simple extends Applet {
StringBuffer buffer;
Image image;
public void init() {
buffer = new StringBuffer();
addItem("initializing... ");
try {
// image = tk.getImage(new URL("http://localip:8080/Radiation/images/radiation/GR1620B.jpg"));
URL url = new URL("http://java.sun.com/images/logos/javalogo52x88.gif");
image = this.getImage(url);
} catch(Exception e) {
System.out.println(e.getMessage());
}
}
public void start() {
addItem("starting... ");
}
public void stop() {
addItem("stopping... ");
}
public void destroy() {
addItem("preparing for unloading...");
}
void addItem(String newWord) {
System.out.println(newWord);
buffer.append(newWord);
repaint();
}
public void paint(Graphics g) {
g.drawImage(image, 0, 0, this);
}
}
Regards,
Sharp