package calculette;

import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionListener;

import javax.swing.JPanel;
/**
 * @author lombardy
 * @version 1.0
 */

@Exercice(3)
public class Clavier extends JPanel {
	public final static long serialVersionUID = 1L;
	/**
	 * Crée le clavier avec toutes ses touches
	 * @param ac l'action listener
	 */
	public Clavier(ActionListener ac){
		setLayout(new GridLayout(4,3));
		add(new Touche('7',ac));
		add(new Touche('8',ac));
		add(new Touche('9',ac));
		add(new Touche('+',ac));
		add(new Touche('4',ac));
		add(new Touche('5',ac));
		add(new Touche('6',ac));
		add(new Touche('-',ac));
		add(new Touche('1',ac));
		add(new Touche('2',ac));
		add(new Touche('3',ac));
		add(new Touche('*',ac));
		add(new Touche('.',ac));
		add(new Touche('0',ac));
		add(new Touche('=',ac));
		add(new Touche('/',ac));
		setPreferredSize(new Dimension(180,200));
	}
}
