import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class HelloSwing extends JFrame implements ActionListener {
	private static final long serialVersionUID = 1L;

	private static final String HELLO = "Hello !";

	public HelloSwing() {
		super(HELLO);
		JButton button = new JButton(HELLO);
		button.addActionListener(this);
		getContentPane().add(button);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		pack();
	}

	public void actionPerformed(ActionEvent e) {
		System.out.println(HELLO);
	}

	public static void creerIHM() {
		setDefaultLookAndFeelDecorated(true);
		JFrame frame = new HelloSwing();
		frame.setVisible(true);

	}

	public static void main(String[] args) {
		javax.swing.SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				creerIHM();
			}
		});
	}
}
