import javax.imageio.ImageIO; public class JResource { /** * load image from a resource * @param args not used */ public static void main ( String[] args ) { // this form requires Applets/JApplets to be signed. BufferedImage p1 = ImageIO.read( JResource.class.getResource( "picture.png" ) ); // alternate BufferedImage p2 = ImageIO.read( JResource.class.getResourceAsStream( "picture.png" ) ); } }