FileDocCategorySizeDatePackage
SnapFrame.javaAPI DocJMF 2.1.1e1318Mon May 12 12:20:30 BST 2003jmapps.ui

SnapFrame

public class SnapFrame extends JMFrame

Fields Summary
private Dimension
dimImage
private Canvas
canvasImage
private Image
image
Constructors Summary
public SnapFrame(Image image)

        this ( image, null );
    
public SnapFrame(Image image, Frame frameOwner)

        super ( frameOwner );

        setLayout ( new BorderLayout() );

        canvasImage = new Canvas() {
            public Dimension getPreferredSize () {
                return ( dimImage );
            }
            public void paint ( Graphics g ) {
                super.paint ( g );
                g.drawImage ( getImage(), 0, 0, this );
            }
        };
        add ( canvasImage, BorderLayout.CENTER );
        setImage ( image );
    
Methods Summary
public java.awt.ImagegetImage()

        return ( image );
    
public voidsetImage(java.awt.Image image)


        this.image = image;
        dimImage = new Dimension ( image.getWidth(this), image.getHeight(this) );
	    pack();
        setVisible(true);
	    canvasImage.repaint();
    
public voidwindowClosing(java.awt.event.WindowEvent event)

        this.setVisible ( false );