| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 
 |  
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
 
import javax.imageio.ImageIO;
import javax.swing.*;
 
import Inscription.moteur_Inscription;
 
public class Jeu {
	JPanel Jeu;
	JButton Acceuil;
	JButton Village;
 
 
	 CardLayout gestionnaireDesCartes = new CardLayout();
	 JPanel jeuCartes = new JPanel();
 
	Jeu() throws IOException{
		Jeu = new JPanel();
		JPanel p = new JPanel();
		 JLabel message = new JLabel("Bonjour1", SwingConstants.CENTER);
		 JLabel message2 = new JLabel("Bonjour2", SwingConstants.CENTER);
		 VoirCercle voirCercle = new VoirCercle();
 
		Acceuil = new JButton("");
		Village = new JButton("");
 
		//Afecte un gestionnaire de présentation a ce panneau
    	BorderLayout disposition = new BorderLayout();
		Jeu.setLayout(disposition);
 
		JFrame frame = new JFrame("History And Futury");
	    frame.setContentPane(Jeu);
	    Jeu.add(jeuCartes); 
 
	    //les different option de la frame 
	    frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
	    frame.add(new imageJeu());
 
	    //donne les mesure de la Frame
	    frame.setBounds(0,0,1280,1028);
	    //rend la frame visible
	    frame.setVisible(true);
 
	    frame.setLayout(null);
 
	    jeuCartes.setLayout(gestionnaireDesCartes); 
	    jeuCartes.setBounds(260,190,955,780);
	    jeuCartes.setOpaque(false);
	    jeuCartes.add(voirCercle, "cercle1");
	    jeuCartes.add(message2, "message2");
 
	    //enregistrer mes bouton dans le panneau menu
	    Jeu.add(Acceuil);
	    Jeu.add(Village);
 
	  //Positionne les bouton a l'endroit indiquer
	    Acceuil.setBounds(60, 462, 100, 17);
	    Village.setBounds(60, 486, 100, 17);
 
	}
 
	public static void main(String[] args) throws IOException {
		Jeu jeu = new Jeu();
 
	}
 
	class imageJeu extends JComponent {
		   private BufferedImage image;
 
		   public imageJeu() throws IOException {
			   image = ImageIO.read(imageJeu.class.getResourceAsStream("Page_Principale.png")); 
 
		   }
		   public imageJeu(BufferedImage image) {
		      this.image = image;
		   }   
		   protected void paintComponent(Graphics surface) {
		      surface.drawImage(image, 0, 0,1272,1000, null);   
		   }   
		}
 
	class VoirCercle extends JComponent {
		   private BufferedImage image;
 
		   public VoirCercle() throws IOException {
			   image = ImageIO.read(VoirCercle.class.getResourceAsStream("bord_Armee.png")); 
 
		   }
		   public VoirCercle(BufferedImage image) {
		      this.image = image;
		   }   
		   protected void paintComponent(Graphics surface) {
		      surface.drawImage(image, 0, 0,800,90, null);   
		   } 
 
		  public class Cercle extends JPanel{
			   JButton bouton1 = new JButton("trace");
			   JButton bouton2 = new JButton("efface");
 
			   Cercle()
			   {
			     setLayout(new FlowLayout(FlowLayout.CENTER,5,100));
			     bouton1.setActionCommand("tracer");
			     bouton2.setActionCommand("effacer");
			     add(bouton1);
			     add(bouton2);
			   }
		   }
		}  
} |