package assignment3;
import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Image;
public class test extends Applet {
private Image logo1;
public void init() {
logo1 = getImage( getCodeBase(), "bg.jpg" );
}
@Override
public void paint( Graphics g ) {
g.drawImage( logo1, 0, 0, this );
}
}
答案 0 :(得分:0)
将.jpg,.html,.class文件放在同一文件夹中,然后使用applet viewer或浏览器运行.html文件。