显示图像的Applet程序(两种方法)
import java.applet.*;import java.awt.*; public class TestBase extends Applet{Image imgCodeBase,imgToolkit; public void init(){//not familiar with getCodeDocument(),so no using itimgCodeBase= getImage(getCodeBase(), "apple.jpg");imgToolkit = Toolkit.getDefaultToolkit().getImage("test.jpg");} public void paint(Graphics g){g.drawImage(imgCodeBase, 0,0,this);g.drawImage(imgToolkit, 120,120,this);} }