URL url = this.getClass().getResource( "images/blueball.gif" );

// Depending on where getResource found the resource,
// the URL will look like one of the following:

// in local jar:
// jar:filE:/E:/com/mindprod/thepackage/thepackage.jar!/com/mindprod/thepackage/images/blueball.gif

// in remote jar:
// jar:http://mindprod.com/thepackage.jar!/com/mindprod/thepackage/images/blueball.gif

// in local file:
// filE:/E:/com/mindprod/thepackage/images/blueball.gif

// in remote file:
// http://mindprod.com/com/mindprod/thepackage/images/blueball.gif

// Once you have the URL, you can get the image.
Image blueball = component.getToolKit().getImage ( url );

// alternatively
URL url = MyClass.class.getResource( "images/blueball.gif" );
Image blueball = component.Toolkit.getDefaultToolkit().createImage( ( ImageProducer ) url.getContent() );