
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;

public class CompteursCIA extends JFrame {
	
	private JButton myButton1,myButton2,myButton3;
	private int countah1,countah2,countah3;
	
	public CompteursCIA() {
			countah1=0;
			countah2=0;
			countah3=0;
			
			this.setLayout(new GridLayout(1,3));
			
			myButton1 = new JButton(Integer.toString(countah1));
			myButton1.addActionListener (
					new ActionListener () {
						public void actionPerformed ( ActionEvent e) {
							countah1++;
							myButton1.setText(Integer.toString(countah1));
						}
					}
					);
			add(myButton1);
			
			myButton2 = new JButton(Integer.toString(countah2));
			myButton2.addActionListener (
					new ActionListener () {
						public void actionPerformed ( ActionEvent e) {
							countah2++;
							myButton2.setText(Integer.toString(countah2));
						}
					}
					);
			add(myButton2);
			
			myButton3 = new JButton(Integer.toString(countah3));
			myButton3.addActionListener (
					new ActionListener () {
						public void actionPerformed ( ActionEvent e) {
							countah3++;
							myButton3.setText(Integer.toString(countah3));
						}
					}
					);
			add(myButton3);
			
			this.pack();
			this.setVisible(true);
			this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

}