Home Segments Top Top Previous Next

842: Mainline

To create an Image instance from an ImageProducer instance, you must use methods associated with the Toolkit class, which specializes in providing connections between your Java program and operating-system mechanisms, such as those that actually spray images on your display.

You obtain a required Toolkit instance by way of a class method, getDefaultToolkit, which returns the appropriate, operating-system–specific toolkit:

Toolkit tk = Toolkit.getDefaultToolkit()