1. 程式人生 > >e557. 在Applet中顯示圖片

e557. 在Applet中顯示圖片

init document pac base let ava ini ntb related

See also e551 精簡的Applet.

    Image image;
    public void init() {
        // Load image
        image = getImage(getDocumentBase(), "http://hostname/image.gif");
    }
    public void paint(Graphics g) {
        // Draw image
        g.drawImage(image, 0, 0, this);
    }

Related Examples

e557. 在Applet中顯示圖片