import java.lang.*;
import java.io.*;
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;




 class xouuyy  {
	private JFrame window;
    private JPanel mainPanel,inputPanel,   buttonPanel;
	 private JTextField jtxtNum1;
	 private JLabel  jlblNum1Caption,jlblNum2Caption;
	 private JButton jbtndey1,jbtndey2;
	 public double counter=0;
     public int contra=0;
 public xouuyy() {



        window = new JFrame("TextGame");


        window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        window.setResizable(true);


        mainPanel = new JPanel(new BorderLayout());
        inputPanel = new JPanel();

	    buttonPanel = new JPanel();


          inputPanel.setLayout(new GridLayout(2, 4, 5, 5));
          buttonPanel.setLayout(new GridLayout(2, 4, 5, 5));


        mainPanel.add(inputPanel, BorderLayout.NORTH);
        mainPanel.add(buttonPanel, BorderLayout.CENTER);



        window.getContentPane().add(mainPanel);


        addButtonsAndTextFields();


        window.pack();
        window.setLocationRelativeTo(null);
        window.setVisible(true);

    }
    ActionListener oty =  new oxuyy();
    public void addButtonsAndTextFields() {


        jbtndey1 = new JButton("deystvio");
        jbtndey2 = new JButton("ne deystvio");








        jtxtNum1 = new JTextField("1");


	       jbtndey1.addActionListener(oty);
	       jbtndey2.addActionListener(oty);

	        buttonPanel.add(jbtndey1);
	         buttonPanel.add(jbtndey2);


	inputPanel.add(jlblNum1Caption);
        inputPanel.add(jtxtNum1);





}

private class oxuyy implements ActionListener{

   @Override
    public void actionPerformed(ActionEvent event) {

        if (event.getSource() == jbtndey1) {
            dey();
            counter++;
		}

        if (event.getSource() == jbtndey2) {
            nedey();
		}


		}

    }


		public void dey() {
		if(counter>=1)
		{jtxtNum1.setText("тест");}
		if(counter>=3)
		{jtxtNum1.setText("номер 1 ");}
                if(counter>=5)
		{jtxtNum1.setText("зделай свой вибор да или нет");

			  }
        if(counter>=7)
		{jtxtNum1.setText("");
        if(contra==1)
        {jtxtNum1.setText("ето бил правильний вибор");}
		else
		{jtxtNum1.setText("ето бил не правильний вибор");}
	}


}
        public void nedey() {

	String df11="nb gbljh";
	int df1=1;
	String fd11 = jtxtNum1.getText();
	int fd1=Integer.parseInt(fd11);
	if (fd1==1)
	{contra++;}


}
}

class zxep{
 public static void main(String[] args) {
xouuyy ouyyyyy = new xouuyy();

}
}