/** A static method for initialing all the images associated with this widget */ private static void loadImages() { // Already in cache, save us from file IO time. if (frames != null) { return; } // Okay, it's not in cache, load the images. try { frames = new ArrayList<BufferedImage>(); for (int i = 0; i < 2; i++) { frames.add(fixTransparency(ImageIO.read(new File(IMAGE_PREFIX + (i + 1) + ".png")))); } } catch (IOException e) { throw new RuntimeException(e); } }