62,616
社区成员
发帖
与我相关
我的任务
分享
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
//package showposition;
import java.awt.Graphics;
import java.awt.Image;
import javax.swing.JApplet;
/**
*
* @author Administrator
*/
public class ShowPosition extends JApplet {
/**
* Initialization method that will be called after the applet is loaded
* into the browser.
*/
private Image image;
public void init() {
// TODO start asynchronous download of heavy resources
System.out.println("base:"+getDocumentBase());
image = getImage(getDocumentBase(),"map.JPG");
}
public void paint(Graphics g){
g.drawImage(image, 0, 0,this);
}
// TODO overwrite start(), stop() and destroy() methods
}
<html>
<applet code = ShowPosition.class width = 260 height = 150>
</applet>
</html>