import java.awt.*; 
import java.awt.event.*; 
import javax.swing.*; 
import javax.swing.border.*;


public class Three_5 extends JFrame  { 


    public Three_5() { 
	super("Three 5");

	getContentPane().setLayout(new FlowLayout());
	getContentPane().setBackground(Color.RED);

	JButton[] knappar = new JButton[3];;
	final JTextField answer = new JTextField ("", 5); 

	answer.setFont(new Font("SansSerif", Font.BOLD, 24));
	add(answer);

	for (int i = 0; i<3; i++) {
	    JButton knapp = knappar[i] = new JButton(i+1+"");
	    knapp.setFont(new Font("SansSerif", Font.BOLD, 24));
	    knapp.setForeground(Color.BLUE);
	    knapp.setBackground(Color.YELLOW);
	    
	    add(knapp);
	}
	
	knappar[0].addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent event) {
		    answer.setText("Ein"); 
		}
	    });

	knappar[1].addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent event) {
		    answer.setText("Dva"); 
		}
	    });

	knappar[2].addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent event) {
		    answer.setText("Trois"); 
		}
	    });

    } 
    
    public static void main(String [] args) { 
	JFrame window = new Three_5();
	window.setBounds(100, 100, 400, 200);
	window.setVisible(true);
	window.setDefaultCloseOperation(EXIT_ON_CLOSE);
    } 
}


