简单问题(极品菜鸟问题)下午就揭贴
import java.awt.*;
import java.applet.*;
import java.awt.image.*;
import java.awt.image.ImageObserver;
import java.net.URL;
public class MyApplet extends Applet implements ImageObserver{
Image img;
String imgPath = "";
int xpoint = 100, ypoint = 100;
public void init() {
setBackground(Color.white); //设置背景色
setForeground(Color.blue); //设置前景色
imgPath ="test.jpg"; //设置图象文件路径
}
public void paint(Graphics g) {
URL imgURL = getDocumentBase();
//Returns an absolute URL naming the directory of the document in which the applet is embedded.
img = getImage(imgURL, imgPath);}
}
怎么在html里显示不出图象来啊?我的test,jpg和html都在一个文件加里
希望指点指点,我是菜鸟