FileDocCategorySizeDatePackage
ppmViewer.javaAPI DocExample1403Mon Mar 24 01:59:58 GMT 1997None

ppmViewer

public class ppmViewer extends Applet

Fields Summary
Image
image
Constructors Summary
Methods Summary
public voidinit()

        
        try {
            String file = getParameter ("file");
            if (file != null) {
                URL imageurl = new URL (getDocumentBase(), file);
                InputStream is = imageurl.openStream();
                PPMImageDecoder ppm = new PPMImageDecoder ();
                ppm.readImage (is);
                image = createImage (ppm);
                repaint();
            }
        } catch (MalformedURLException me) {
            System.out.println ("Bad URL");
         } catch (IOException io) {
            System.out.println ("Bad File");
        }
    
public voidpaint(java.awt.Graphics g)

        g.drawImage (image, 0, 0, this);