url = new URL(link);
}
Toolkit tk = Toolkit.getDefaultToolkit();
Image img = tk.getImage(url);
PaintedImage image = new PaintedImage(img, bounds);
// Wait until the image has been completely loaded,
// unless an error occurred.
while (true) {
if (tk.prepareImage(img, -1, -1, image)) {