/**
*Programme cree par The Clusters
*Classe AfficheImage du jeu "Chkoba"
*@author The Clusters
*@version 1.0
**/

package chkoba;

import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import chkoba.*;

/**
*	Classe AfficheImage
*/

public class AfficheImage extends Frame{
    private Image image;

    public AfficheImage() {
       setTitle("AfficheImage");
       setLocation(50,100);
       //~ setSize(300,200);
	setLayout(new GridLayout(8,7));
	String nom="test.jpg";

       image = Toolkit.getDefaultToolkit().getImage(nom);

       MediaTracker track = new MediaTracker(this);

       // 0 est l'identifiant de l'image a charger
       track.addImage(image, 0);

       try {
          track.waitForID(0);
       } catch (InterruptedException e) {}
	       
	addWindowListener(new WindowAdapter()
	{
		public void windowClosing(WindowEvent evt)
		{
			System.exit(0);
		}
	});
	
	add(new Button ( "ok"));
	add(new Label());
	add(new Button ( "ok"));

	setSize(new Dimension(image.getWidth(null)+8,image.getHeight(null)+32));

     setVisible(true);
    }

    public void paint(Graphics g) {
        g.drawImage(image,getInsets().left,getInsets().top, null);
    }

    public static void main(String [] arg) {
        new AfficheImage();
    }
}
