e595. Drawing an Image

See also e575 The Quintessential Drawing Program and e594 Reading an Image or Icon from a File.

    public void paint(Graphics g) {
        // Draw an Image object
        int x = 0;
        int y = 0;
        g.drawImage(image, x, y, this);
    
        // Draw an Icon object
        x = 0;
        y = 100;
        icon.paintIcon(this, g, x, y);
    }

 

Related Examples
posted @ 2018-09-06 08:29  borter  阅读(100)  评论(0编辑  收藏  举报