Image

Imagejavac wrote in Imagejava_dev 😊thoughtful

Java (applet) Images

From the init section of the code:

ball_image = getImage(getCodeBase(), "red_ball.gif");
System.out.println(ball_image.getWidth(this));
System.out.println(ball_image.getHeight(this));

It always prints -1 and -1, what's up with that? The image paints just fine but it's not reporting the size. Unless I'm just forgetting something important about doing images ...