public static BufferedImage readImage(String remoteurl) {
		BufferedImage image = null;
		boolean flag = false;
		long startTime = System.currentTimeMillis();
		do {
			try {
				URLConnection connection = getURLConnection(remoteurl);
				image = ImageIO.read(connection.getInputStream());
				if (flag)
					System.out.println("it takes about "
							+ (System.currentTimeMillis() - startTime) / 1000
							+ " seconds to download " + remoteurl);
			} catch (MalformedURLException e) {
				System.out.println(e.getMessage());
				flag = true;
				pause();
			} catch (IOException e) {
				System.out.println(e.getMessage());
				flag = true;
				pause();
			}
		} while (image == null);
		return image;
	}