First off you'll have to be using 1.4, otherwise you won't be able to take advantage. Secondly have a look for VolatileImage, which is stored only in vRam and which you need to do management of image loss manually. However there are a couple of snafus that may trip you up with volative images, namely i dont think you can do any sort of transparency
There's also 'AutomaticImages' which are regular BufferedImages which the VM will attempt to cache in vRam, and handle management itself. With the correct massaging you can also get these to have 1-bit transparency and still be hardware accelerated.
A code snippit from my (now on permanent hold,
) Phoenix project:
public BufferedImage loadImage(String filename, boolean solid)
Image tempImage = new ImageIcon(filename).getImage();
BufferedImage sprite = null;
int spriteW = tempImage.getWidth(null);
int spriteH = tempImage.getHeight(null);
if (spriteW != -1)
sprite = graphicsConfig.createCompatibleImage(spriteW, spriteH, Transparency.OPAQUE);
sprite = graphicsConfig.createCompatibleImage(spriteW, spriteH, Transparency.BITMASK);
Graphics2D g = (Graphics2D)sprite.getGraphics();
g.drawImage(tempImage, null, null);
System.out.println("Error loading images: " + filename + " not found");
Jeff et al, if you're reading this - how long until we see a full site with the articles section up again?