private static Image loadImage(File path) {
    Image image = Toolkit.getDefaultToolkit().createImage(path.getAbsolutePath());
    waitForImage(image);
    return image;
  }
private static Image loadImage(File path)