BasicDraw.java Source code

Java tutorial

Introduction

Here is the source code for BasicDraw.java

Source

import java.awt.Image;
import java.awt.Toolkit;

public class BasicDraw {
    public static void main(String[] args) {
        Image image = Toolkit.getDefaultToolkit().getImage("image.gif");
        int width = image.getWidth(null);
        int height = image.getHeight(null);

        if (width >= 0) {
            // The image has been fully loaded
        } else {
            // The image has not been fully loaded
        }

    }
}