public void setImage(Image image) { int iw = image.getWidth(null); int ih = image.getHeight(null); this.image = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_ARGB);        Graphics2D tg = this.image.createGraphics();  tg.drawImage(image, 0, 0, iw, ih, 0, 0, iw, ih, null);
public void setImage(BufferedImage image) { this.image = image;
    public void setImage(Image image) {        int iw = image.getWidth(null);        int ih = image.getHeight(null);        this.image = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_ARGB);        //FIXME: although faster, the following doesn't seem to handle alpha on some platforms...        //GraphicsConfiguration config =            //GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration();                //Image tilesetImage = config.createCompatibleImage(tileWidth, tileHeight);        //Graphics tg = tilesetImage.getGraphics();        Graphics2D tg = this.image.createGraphics();        tg.drawImage(image,                0, 0, iw, ih,                0, 0, iw, ih,                null);    }