IntBuffer buff = org.lwjgl.BufferUtils.createIntBuffer(width * height);
IntBuffer buff = ByteBuffer.allocateDirect(width * height * 4).order( ByteOrder.LITTLE_ENDIAN).asIntBuffer();
    public boolean takeScreenShot(String filename) {        if (null == filename) {            throw new JmeException("Screenshot filename cannot be null");        }        LoggingSystem.getLogger().log(Level.INFO,                "Taking screenshot: " + filename + ".png");        // Create a pointer to the image info and create a buffered image to        // hold it.        IntBuffer buff = org.lwjgl.BufferUtils.createIntBuffer(width * height);        grabScreenContents(buff, 0, 0, width, height);        BufferedImage img = new BufferedImage(width, height,                BufferedImage.TYPE_INT_RGB);        // Grab each pixel information and set it to the BufferedImage info.        for (int x = 0; x < width; x++) {            for (int y = 0; y < height; y++) {                img.setRGB(x, y, buff.get((height - y - 1) * width + x));            }        }        // write out the screenshot image to a file.        try {            File out = new File(filename + ".png");            return ImageIO.write(img, "png", out);        } catch (IOException e) {            LoggingSystem.getLogger().log(Level.WARNING,                    "Could not create file: " + filename + ".png");            return false;        }    }