Hello, I try to create a loop in my program. I try to let the computer play the 'monthy hall' game. The game where a player can choose out of 3 doors, then the presentor opens a door with a goat and then the player has the option to switch or not. I try to let the computer regenerate this situation and do it for like a 1000 times or whatever the user want's the computer to do.

I tried to create a loop. 'text' is the value the user want's the computer to regenerate this situation. Later on 'nul' is the same value as 'text' and for every time the loop is done 'nul' lowers with -1. So when 'nul' == 0, it should stop and bring out the results. Like if the computer won for 333 times (the setting here is that the computer didn't switch anytime) and lost for 667 times.

I have the code created, but it doesn't bring out the results. I am not sure, but I think the problem is the loop, but if it was the loop it should at least bring out one result. A result like 'won' = 1 and 'lost = 0' or 'won' = 0 and 'lost' = 1. But the outcoming result is always 'won' = 0 and 'lost' = 0. Like if it doesn't even update the 'won' and 'lost' variable.

Is there something I forgot to put into my code? The code it is all about is the first codebox under this text. For the interested people, the whole code of the whole program is in the second codebox under this text. It includes the 'generate by computer' option and the option to play the game on your own. No problem is in that part of the code. The language of the game is in dutch, but that isn't so hard to understand.

*I define variables in textfields. I don't now how to make them global in another way.
Java Code:
	void generate2Button_ActionPerformed(java.awt.event.ActionEvent event)
	{
	    Checkbox button;
	    String lbl1;
	    String lbl2;
	    String lbl3;
	    int text;
	    int lost;
	    int won;
	    //won = 0;
	    //lost = 0;
	    button = Group1.getSelectedCheckbox();
	    lbl1 = radioButton1.getLabel();
	    lbl2 = radioButton2.getLabel();
	    lbl3 = button.getLabel();
	    text = Integer.parseInt(numgen_field.getText());
	    r3_text.setText(String.valueOf(text));
	    if (text >= 0)
	    {
	        if (lbl3 == lbl1) // zonder
	        {
	            int i;
				i = Integer.parseInt(r6_text.getText());
				do
	            {
	                i = Integer.parseInt(r6_text.getText());
	                i = i - 1;
	                r6_text.setText(String.valueOf(i));
	                int deur0;
	                int deur1;
	                int deur2;
	                int ran;
	                Random randomDeur = new Random();
		            deur0 = randomDeur.nextInt(2);
		            if (deur0 == 0)
		            {
		                deur1 = 1;
		                deur2 = 1;
		            }
		            else
		            {
		                deur1 = randomDeur.nextInt(2);
		                if (deur1 == 0)
		                {
		                    deur0 = 1;
		                    deur2 = 1;
		                }
		                else
		                {
		                    deur0 = 1;
		                    deur1 = 1;
		                    deur2 = 0;
		                }
		            }
		            ran = deur1 = randomDeur.nextInt(3);
		            if (ran == 0)
		            {
		                if (deur0 == 0)
		                {
		                    //won = won + 1;
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    //lost = lost + 1;
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
		            else if (ran == 1)
		            {
		                if (deur1 == 0)
		                {
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
		            else if (ran == 2)
		            {
		                if (deur2 == 0)
		                {
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
	            }
	            while (Integer.parseInt(r6_text.getText()) > 0);
	        }
	        else if (lbl3 == lbl2) // met
	        {
	            
	        }
	        generate2_button.setVisible(false);
	        numgen_text.setVisible(false);
	        numgen_field.setVisible(false);
	        radioButton1.setVisible(false);
	        radioButton2.setVisible(false);
	        lost_field.setVisible(true);
	        won_field.setVisible(true);
	        label1.setVisible(true);
	        label2.setVisible(true);
	        again_button.setVisible(true);
	        won = Integer.parseInt(r4_text.getText());
	        lost = Integer.parseInt(r5_text.getText());
	        won_field.setText(String.valueOf(won));
	        lost_field.setText(String.valueOf(lost));
	        
	    }
	    else
	    {
	        // to do
	        setBackground(java.awt.Color.yellow);
	    }
	}
*There are a lot of unused textfields and parts of code in the whole file. But that doesn't effect the working of the file.
Java Code:
/*
	A basic extension of the java.applet.Applet class
 */

import java.awt.*;
import java.applet.*;
import java.util.*;

public class Applet1 extends Applet
{
	public void init()
	{
		// Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller
		symantec.itools.lang.Context.setApplet(this);
	
		// This code is automatically generated by Visual Cafe when you add
		// components to the visual environment. It instantiates and initializes
		// the components. To modify the code, only use code syntax that matches
		// what Visual Cafe can generate, or Visual Cafe may be unable to back
		// parse your Java file into its visual environment.
		//{{INIT_CONTROLS
		setLayout(null);
		setBackground(java.awt.Color.lightGray);
		setForeground(java.awt.Color.black);
		setSize(426,266);
		start_button.setLabel("START");
		add(start_button);
		start_button.setFont(new Font("Dialog", Font.PLAIN, 12));
		start_button.setBounds(120,84,181,102);
		deur1_button.setLabel("Deur 1");
		add(deur1_button);
		deur1_button.setBounds(24,72,79,136);
		deur1_button.setVisible(false);
		deur2_button.setLabel("Deur 2");
		add(deur2_button);
		deur2_button.setBounds(180,72,79,136);
		deur2_button.setVisible(false);
		deur3_button.setLabel("Deur 3");
		add(deur3_button);
		deur3_button.setBounds(336,72,79,136);
		deur3_button.setVisible(false);
		kies1_text.setText("U kiest deze");
		add(kies1_text);
		kies1_text.setBounds(24,36,72,24);
		kies1_text.setVisible(false);
		kies2_text.setText("U kiest deze");
		add(kies2_text);
		kies2_text.setBounds(180,36,72,24);
		kies2_text.setVisible(false);
		kies3_text.setText("U kiest deze");
		add(kies3_text);
		kies3_text.setBounds(336,36,72,24);
		kies3_text.setVisible(false);
		switch_button.setLabel("Switchen");
		add(switch_button);
		switch_button.setBounds(24,228,252,36);
		switch_button.setVisible(false);
		kies_button.setLabel("Kiezen");
		add(kies_button);
		kies_button.setBounds(288,228,120,36);
		kies_button.setVisible(false);
		keus1_text.setText("text");
		add(keus1_text);
		keus1_text.setForeground(java.awt.Color.lightGray);
		keus1_text.setBounds(24,12,69,22);
		keus1_text.setVisible(false);
		keus2_text.setText("text");
		add(keus2_text);
		keus2_text.setForeground(java.awt.Color.lightGray);
		keus2_text.setBounds(180,12,69,22);
		keus2_text.setVisible(false);
		keus3_text.setText("text");
		add(keus3_text);
		keus3_text.setForeground(java.awt.Color.lightGray);
		keus3_text.setBounds(324,12,69,22);
		keus3_text.setVisible(false);
		gekbut.setText("1");
		add(gekbut);
		gekbut.setForeground(java.awt.Color.lightGray);
		gekbut.setBounds(108,12,32,22);
		gekbut.setVisible(false);
		opendeur.setText("1");
		add(opendeur);
		opendeur.setForeground(java.awt.Color.lightGray);
		opendeur.setBounds(108,36,32,22);
		opendeur.setVisible(false);
		again_button.setLabel("AGAIN");
		add(again_button);
		again_button.setBounds(24,228,384,36);
		again_button.setVisible(false);
		status_text.setText("YOU WON!");
		status_text.setAlignment(java.awt.Label.CENTER);
		add(status_text);
		status_text.setBounds(24,12,384,36);
		status_text.setVisible(false);
		hoofd_text.setText("hoofdprijs");
		add(hoofd_text);
		hoofd_text.setBounds(240,84,84,24);
		hoofd_text.setVisible(false);
		troost_text.setText("troostprijs");
		add(troost_text);
		troost_text.setBounds(240,108,84,24);
		troost_text.setVisible(false);
		abc1.setText("Hoofdprijs:");
		add(abc1);
		abc1.setBounds(96,84,60,24);
		abc1.setVisible(false);
		abc2.setText("Troostprijs:");
		add(abc2);
		abc2.setBounds(96,108,72,24);
		abc2.setVisible(false);
		habs.setText("0");
		add(habs);
		habs.setForeground(java.awt.Color.lightGray);
		habs.setBounds(0,12,20,15);
		habs.setVisible(false);
		generate_button.setLabel("Computer generate");
		add(generate_button);
		generate_button.setBounds(120,192,180,36);
		generate2_button.setLabel("Generate");
		add(generate2_button);
		generate2_button.setBounds(120,192,180,36);
		generate2_button.setVisible(false);
		numgen_text.setText("Numbers to generate");
		add(numgen_text);
		numgen_text.setBounds(72,144,132,24);
		numgen_text.setVisible(false);
		add(numgen_field);
		numgen_field.setBounds(216,144,96,24);
		numgen_field.setVisible(false);
		add(lost_field);
		lost_field.setBounds(216,144,96,24);
		lost_field.setVisible(false);
		add(won_field);
		won_field.setBounds(216,108,96,24);
		won_field.setVisible(false);
		label1.setText("Won:");
		label1.setVisible(false);
		add(label1);
		label1.setBounds(168,108,36,24);
		label2.setText("Lost:");
		add(label2);
		label2.setBounds(168,144,36,24);
		label2.setVisible(false);
		radioButton1.setCheckboxGroup(Group1);
		radioButton1.setLabel("with switch");
		add(radioButton1);
		radioButton1.setBounds(180,84,84,24);
		radioButton1.setVisible(false);
		radioButton2.setCheckboxGroup(Group1);
		radioButton2.setLabel("without switch");
		add(radioButton2);
		radioButton2.setBounds(180,108,96,24);
		radioButton2.setVisible(false);
		r1_text.setText("0");
		add(r1_text);
		//r1_text.setForeground(java.awt.Color.lightGray);
		r1_text.setBounds(12,132,11,19);
		//r1_text.setVisible(false);
		r2_text.setText("0");
		add(r2_text);
		//r2_text.setForeground(java.awt.Color.lightGray);
		r2_text.setBounds(12,108,11,19);
		//r2_text.setVisible(false);
		r3_text.setText("0");
		add(r3_text);
		r3_text.setForeground(java.awt.Color.lightGray);
		r3_text.setBounds(12,120,11,19);
		r3_text.setVisible(false);
		r4_text.setText("0");
		add(r4_text);
		r4_text.setBounds(12,168,11,19);
		r5_text.setText("0");
		add(r5_text);
		r5_text.setBounds(12,192,11,19);
		r6_text.setText("0");
		add(r6_text);
		r6_text.setBounds(12,216,11,19);
		//}}
	
		//{{REGISTER_LISTENERS
		SymAction lSymAction = new SymAction();
		start_button.addActionListener(lSymAction);
		deur1_button.addActionListener(lSymAction);
		deur2_button.addActionListener(lSymAction);
		deur3_button.addActionListener(lSymAction);
		switch_button.addActionListener(lSymAction);
		kies_button.addActionListener(lSymAction);
		again_button.addActionListener(lSymAction);
		generate_button.addActionListener(lSymAction);
		generate2_button.addActionListener(lSymAction);
		SymItem lSymItem = new SymItem();
		radioButton2.addItemListener(lSymItem);
		radioButton1.addItemListener(lSymItem);
		SymText lSymText = new SymText();
		numgen_field.addTextListener(lSymText);
		//}}
		
		 
	}
	
	//{{DECLARE_CONTROLS
	java.awt.Button start_button = new java.awt.Button();
	java.awt.Button deur1_button = new java.awt.Button();
	java.awt.Button deur2_button = new java.awt.Button();
	java.awt.Button deur3_button = new java.awt.Button();
	java.awt.Label kies1_text = new java.awt.Label();
	java.awt.Label kies2_text = new java.awt.Label();
	java.awt.Label kies3_text = new java.awt.Label();
	java.awt.Button switch_button = new java.awt.Button();
	java.awt.Button kies_button = new java.awt.Button();
	java.awt.Label keus1_text = new java.awt.Label();
	java.awt.Label keus2_text = new java.awt.Label();
	java.awt.Label keus3_text = new java.awt.Label();
	java.awt.Label gekbut = new java.awt.Label();
	java.awt.Label opendeur = new java.awt.Label();
	java.awt.Button again_button = new java.awt.Button();
	java.awt.Label status_text = new java.awt.Label();
	java.awt.Label hoofd_text = new java.awt.Label();
	java.awt.Label troost_text = new java.awt.Label();
	java.awt.Label abc1 = new java.awt.Label();
	java.awt.Label abc2 = new java.awt.Label();
	java.awt.Label habs = new java.awt.Label();
	java.awt.Button generate_button = new java.awt.Button();
	java.awt.Button generate2_button = new java.awt.Button();
	java.awt.Label numgen_text = new java.awt.Label();
	java.awt.TextField numgen_field = new java.awt.TextField();
	java.awt.TextField lost_field = new java.awt.TextField();
	java.awt.TextField won_field = new java.awt.TextField();
	java.awt.Label label1 = new java.awt.Label();
	java.awt.Label label2 = new java.awt.Label();
	java.awt.Checkbox radioButton1 = new java.awt.Checkbox();
	java.awt.CheckboxGroup Group1 = new java.awt.CheckboxGroup();
	java.awt.Checkbox radioButton2 = new java.awt.Checkbox();
	java.awt.Label r1_text = new java.awt.Label();
	java.awt.Label r2_text = new java.awt.Label();
	java.awt.Label r3_text = new java.awt.Label();
	java.awt.Label r4_text = new java.awt.Label();
	java.awt.Label r5_text = new java.awt.Label();
	java.awt.Label r6_text = new java.awt.Label();
	//}}
	

	class SymAction implements java.awt.event.ActionListener
	{
		public void actionPerformed(java.awt.event.ActionEvent event)
		{
			Object object = event.getSource();
			if (object == start_button)
				startButton_ActionPerformed(event);
			else if (object == deur1_button)
				deur1Button_ActionPerformed(event);
			else if (object == deur2_button)
				deur2Button_ActionPerformed(event);
			else if (object == deur3_button)
				deur3Button_ActionPerformed(event);
			else if (object == switch_button)
				switchButton_ActionPerformed(event);
			else if (object == kies_button)
				kiesButton_ActionPerformed(event);
			else if (object == again_button)
				againButton_ActionPerformed(event);
			else if (object == generate_button)
				generateButton_ActionPerformed(event);
			else if (object == generate2_button)
				generate2Button_ActionPerformed(event);
		}
	}

	void startButton_ActionPerformed(java.awt.event.ActionEvent event)
	{
	    generate_button.setVisible(false);
	    int hab;
	    hab = Integer.parseInt(habs.getText());
	    if (hab == 1)
	    {
		    habs.setText("0");
		    start_button.setVisible(false);
		    start_button.setBounds(120,84,181,102);
		    hoofd_text.setVisible(false);
		    troost_text.setVisible(false);
		    abc1.setVisible(false);
		    abc2.setVisible(false);
		    deur1_button.setVisible(true);
		    deur2_button.setVisible(true);
		    deur3_button.setVisible(true);
		    deur1_button.setBackground(java.awt.Color.lightGray);
		    deur2_button.setBackground(java.awt.Color.lightGray);
		    deur3_button.setBackground(java.awt.Color.lightGray);
		    deur1_button.setEnabled(true);
		    deur2_button.setEnabled(true);
		    deur3_button.setEnabled(true);
		    Random randomGenerator = new Random();
		    int geit;
		    int deur1_geit;
		    int deur2_geit;
		    int deur3_geit;
		    deur1_geit = randomGenerator.nextInt(2);
		    geit = 1;
		    if (deur1_geit == 0)
		    {
		        deur2_geit = 1;
		        deur3_geit = 1;
		        keus1_text.setText("0");
		        keus2_text.setText("1");
		        keus3_text.setText("1");
		    }
		    else
		    {
		        deur2_geit = randomGenerator.nextInt(2);
		        if (deur2_geit == 0)
		        {
		            deur3_geit = 1;
		            keus1_text.setText("1");
		            keus2_text.setText("0");
		            keus3_text.setText("1");
		        }
		        else
		        {
		            deur3_geit = 0;
		            keus1_text.setText("1");
		            keus2_text.setText("1");
		            keus3_text.setText("0");
		        }
		    }
		}
		else
		{
		    start_button.setBounds(24,180,384,84);
		    habs.setText("1");
		    hoofd_text.setVisible(true);
		    troost_text.setVisible(true);
		    abc1.setVisible(true);
		    abc2.setVisible(true);
		    int ran;
		    Random randomGenerator3 = new Random();
		    ran = randomGenerator3.nextInt(5);
		    if (ran == 0)
		    {
		        hoofd_text.setText("bloemkool");
		        troost_text.setText("banaan");
		    }
		    else if (ran == 1)
		    {
		        hoofd_text.setText("Ferrari");
		        troost_text.setText("Suzuki");
		    }
		    else if (ran == 2)
		    {
		        hoofd_text.setText("biertje");
		        troost_text.setText("wijntje");
		    }
		    else if (ran == 3)
		    {
		        hoofd_text.setText("foto camera");
		        troost_text.setText("usb-stick");
		    }
		    else if (ran == 4)
		    {
		        hoofd_text.setText("boom");
		        troost_text.setText("papier");
		    }
		}
	}

	void deur1Button_ActionPerformed(java.awt.event.ActionEvent event)
	{
		kies1_text.setVisible(true);
		gekbut.setText("1");
		deur1_button.setEnabled(false);
		deur2_button.setEnabled(false);
		deur3_button.setEnabled(false);
		kies_button.setVisible(true);
		switch_button.setVisible(true);
		Random randomGenerator2 = new Random();
		int deur;
		deur = randomGenerator2.nextInt(2);
		int deur1_geit;
		int deur2_geit;
		int deur3_geit;
		deur1_geit = Integer.parseInt(keus1_text.getText());
		deur2_geit = Integer.parseInt(keus2_text.getText());
		deur3_geit = Integer.parseInt(keus3_text.getText());
		if (deur == 0)
		{
		    if (deur2_geit == 1)
		    {
		        deur2_button.setBackground(java.awt.Color.red);
		        opendeur.setText("2");
		    }
		    else
		    {
		        deur3_button.setBackground(java.awt.Color.red);
		        opendeur.setText("3");
		    }
		}
		else
		{
		    if (deur3_geit == 1)
		    {
		        deur3_button.setBackground(java.awt.Color.red);
		        opendeur.setText("3");
		    }
		    else
		    {
		        deur2_button.setBackground(java.awt.Color.red);
		        opendeur.setText("2");
		    }
		}
	}

	void deur2Button_ActionPerformed(java.awt.event.ActionEvent event)
	{
		kies2_text.setVisible(true);
		gekbut.setText("2");
		deur1_button.setEnabled(false);
		deur2_button.setEnabled(false);
		deur3_button.setEnabled(false);
		kies_button.setVisible(true);
		switch_button.setVisible(true);
		Random randomGenerator2 = new Random();
		int deur;
		deur = randomGenerator2.nextInt(2);
		int deur1_geit;
		int deur2_geit;
		int deur3_geit;
		deur1_geit = Integer.parseInt(keus1_text.getText());
		deur2_geit = Integer.parseInt(keus2_text.getText());
		deur3_geit = Integer.parseInt(keus3_text.getText());
		if (deur == 0)
		{
		    if (deur1_geit == 1)
		    {
		        deur1_button.setBackground(java.awt.Color.red);
		        opendeur.setText("1");
		    }
		    else
		    {
		        deur3_button.setBackground(java.awt.Color.red);
		        opendeur.setText("3");
		    }
		}
		else
		{
		    if (deur3_geit == 1)
		    {
		        deur3_button.setBackground(java.awt.Color.red);
		        opendeur.setText("3");
		    }
		    else
		    {
		        deur1_button.setBackground(java.awt.Color.red);
		        opendeur.setText("1");
		    }
		}	 
	}

	void deur3Button_ActionPerformed(java.awt.event.ActionEvent event)
	{
		kies3_text.setVisible(true);
		gekbut.setText("3");
		deur1_button.setEnabled(false);
		deur2_button.setEnabled(false);
		deur3_button.setEnabled(false);
		kies_button.setVisible(true);
		switch_button.setVisible(true);
		Random randomGenerator2 = new Random();
		int deur;
		deur = randomGenerator2.nextInt(2);
		int deur1_geit;
		int deur2_geit;
		int deur3_geit;
		deur1_geit = Integer.parseInt(keus1_text.getText());
		deur2_geit = Integer.parseInt(keus2_text.getText());
		deur3_geit = Integer.parseInt(keus3_text.getText());
		if (deur == 0)
		{
		    if (deur1_geit == 1)
		    {
		        deur1_button.setBackground(java.awt.Color.red);
		        opendeur.setText("1");
		    }
		    else
		    {
		        deur2_button.setBackground(java.awt.Color.red);
		        opendeur.setText("2");
		    }
		}
		else
		{
		    if (deur2_geit == 1)
		    {
		        deur2_button.setBackground(java.awt.Color.red);
		        opendeur.setText("2");
		    }
		    else
		    {
		        deur1_button.setBackground(java.awt.Color.red);
		        opendeur.setText("1");
		    }
		}	 
	}

	void switchButton_ActionPerformed(java.awt.event.ActionEvent event)
	{
		int gekbut2;
		int deur1_geit;
		int deur2_geit;
		int deur3_geit;
		int opendeur2;
		opendeur2 = Integer.parseInt(opendeur.getText());
		gekbut2 = Integer.parseInt(gekbut.getText());
		deur1_geit = Integer.parseInt(keus1_text.getText());
		deur2_geit = Integer.parseInt(keus2_text.getText());
		deur3_geit = Integer.parseInt(keus3_text.getText());
		if (gekbut2 == 1)
		{
		    if (opendeur2 == 2)
		    {
		        gekbut.setText("3");
		        kies1_text.setVisible(false);
		        kies3_text.setVisible(true);
		    }
		    else
		    {
		        gekbut.setText("2");
		        kies1_text.setVisible(false);
		        kies2_text.setVisible(true);
		    }
		}
		else
		{
		    if (gekbut2 == 2)
	    	{
		        if (opendeur2 == 1)
		        {
		            gekbut.setText("3");
		            kies2_text.setVisible(false);
		            kies3_text.setVisible(true);
		        }
		        else
		        {
		            gekbut.setText("1");
		            kies2_text.setVisible(false);
		            kies1_text.setVisible(true);
		        }
		    }
		    else
		    {
		        if (opendeur2 == 1)
		        {
		            gekbut.setText("2");
		            kies3_text.setVisible(false);
		            kies2_text.setVisible(true);
		        }
		        else
		        {
		            gekbut.setText("1");
		            kies3_text.setVisible(false);
		            kies1_text.setVisible(true);
		        }
		    }
		}
			 
	}

	void kiesButton_ActionPerformed(java.awt.event.ActionEvent event)
	{
		int deur1_geit;
		int deur2_geit;
		int deur3_geit;
		int gekbut2;
		deur1_geit = Integer.parseInt(keus1_text.getText());
		deur2_geit = Integer.parseInt(keus2_text.getText());
		deur3_geit = Integer.parseInt(keus3_text.getText());
		gekbut2 = Integer.parseInt(gekbut.getText());
		if (gekbut2 == 1)
		{
		    if (deur1_geit == 0)
		    {
		        deur1_button.setBackground(java.awt.Color.green);
		        deur2_button.setBackground(java.awt.Color.red);
		        deur3_button.setBackground(java.awt.Color.red);
		        status_text.setVisible(true);
		        again_button.setVisible(true);
		        switch_button.setVisible(false);
		        kies_button.setVisible(false);
		        String prijs;
		        String prijs2;
		        prijs = hoofd_text.getText();
		        prijs2 = prijs;//.toUpperCase();
		        status_text.setText("Gewonnen! Hoofdprijs: een " + prijs2 +"!");
		    }
		    else
		    {
		        deur1_button.setBackground(java.awt.Color.red);
		        if (deur2_geit == 0)
		        {
		            deur2_button.setBackground(java.awt.Color.green);
		            deur3_button.setBackground(java.awt.Color.red);
		            status_text.setVisible(true);
		            again_button.setVisible(true);
		            switch_button.setVisible(false);
		            kies_button.setVisible(false);
		            String prijs;
		            String prijs2;
		            prijs = troost_text.getText();
		            prijs2 = prijs;//.toUpperCase();
		            status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		        }
		        else
		        {
		            deur3_button.setBackground(java.awt.Color.green);
		            deur2_button.setBackground(java.awt.Color.red);
		            status_text.setVisible(true);
		            again_button.setVisible(true);
		            switch_button.setVisible(false);
		            kies_button.setVisible(false);
		            String prijs;
		            String prijs2;
		            prijs = troost_text.getText();
		            prijs2 = prijs;//.toUpperCase();
		            status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		        }
		    }
		}
		else
		{
		    if (gekbut2 == 2)
		    {
		        if (deur2_geit == 0)
		        {
		            deur2_button.setBackground(java.awt.Color.green);
		            deur1_button.setBackground(java.awt.Color.red);
		            deur3_button.setBackground(java.awt.Color.red);
		            status_text.setVisible(true);
		            again_button.setVisible(true);
		            switch_button.setVisible(false);
		            kies_button.setVisible(false);
		            String prijs;
		            String prijs2;
		            prijs = hoofd_text.getText();
		            prijs2 = prijs;//.toUpperCase();
		            status_text.setText("Gewonnen! Hoofdprijs: een " + prijs2 +"!");
		        }
		        else
		        {
		            deur2_button.setBackground(java.awt.Color.red);
		            if (deur1_geit == 0)
		            {
		                deur1_button.setBackground(java.awt.Color.green);
		                deur3_button.setBackground(java.awt.Color.red);
		                status_text.setVisible(true);
		                again_button.setVisible(true);
		                switch_button.setVisible(false);
		                kies_button.setVisible(false);
		                String prijs;
		                String prijs2;
		                prijs = troost_text.getText();
		                prijs2 = prijs;//.toUpperCase();
		                status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		            }
		            else
		            {
		                deur3_button.setBackground(java.awt.Color.green);
		                deur1_button.setBackground(java.awt.Color.red);
		                status_text.setVisible(true);
		                again_button.setVisible(true);
		                switch_button.setVisible(false);
		                kies_button.setVisible(false);
		                String prijs;
		                String prijs2;
		                prijs = troost_text.getText();
		                prijs2 = prijs;//.toUpperCase();
		                status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		            }
		        }
		    }
		    else
		    {
		        if (deur3_geit == 0)
		        {
		            deur3_button.setBackground(java.awt.Color.green);
		            deur1_button.setBackground(java.awt.Color.red);
		            deur2_button.setBackground(java.awt.Color.red);
		            status_text.setVisible(true);
		            again_button.setVisible(true);
		            switch_button.setVisible(false);
		            kies_button.setVisible(false);
		            String prijs;
		            String prijs2;
		            prijs = hoofd_text.getText();
		            prijs2 = prijs;//.toUpperCase();
		            status_text.setText("Gewonnen! Hoofdprijs: een " + prijs2 +"!");
		        }
		        else
		        {
		            deur3_button.setBackground(java.awt.Color.red);
		            if (deur1_geit == 0)
		            {
		                deur1_button.setBackground(java.awt.Color.green);
		                deur2_button.setBackground(java.awt.Color.red);
		                status_text.setVisible(true);
		                again_button.setVisible(true);
		                switch_button.setVisible(false);
		                kies_button.setVisible(false);
		                String prijs;
		                String prijs2;
		                prijs = troost_text.getText();
		                prijs2 = prijs;//.toUpperCase();
		                status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		            }
		            else
		            {
		                deur1_button.setBackground(java.awt.Color.green);
		                deur2_button.setBackground(java.awt.Color.red);
		                status_text.setVisible(true);
		                again_button.setVisible(true);
		                switch_button.setVisible(false);
		                kies_button.setVisible(false);
		                String prijs;
		                String prijs2;
		                prijs = troost_text.getText();
		                prijs2 = prijs;//.toUpperCase();
		                status_text.setText("Verloren! Troostprijs: een " + prijs2 + "!");
		            }
		        }
		    }
		}
	}

	void againButton_ActionPerformed(java.awt.event.ActionEvent event)
	{
		start_button.setVisible(true);
		//hoofd_text.setVisible(true);
		//troost_text.setVisible(true);
		//abc1.setVisible(true);
		//abc2.setVisible(true);
		again_button.setVisible(false);
		deur1_button.setVisible(false);
		deur2_button.setVisible(false);
		deur3_button.setVisible(false);
		status_text.setVisible(false);
		kies1_text.setVisible(false);
		kies2_text.setVisible(false);
		kies3_text.setVisible(false);
		generate_button.setVisible(true);
	}

	void generateButton_ActionPerformed(java.awt.event.ActionEvent event)
	{
		start_button.setVisible(false);
		generate_button.setVisible(false);
		generate2_button.setVisible(true);
		numgen_field.setVisible(true);
		numgen_text.setVisible(true);
		radioButton1.setVisible(true);
		radioButton2.setVisible(true);
			 
	}

	void generate2Button_ActionPerformed(java.awt.event.ActionEvent event)
	{
	    Checkbox button;
	    String lbl1;
	    String lbl2;
	    String lbl3;
	    int text;
	    int lost;
	    int won;
	    //won = 0;
	    //lost = 0;
	    button = Group1.getSelectedCheckbox();
	    lbl1 = radioButton1.getLabel();
	    lbl2 = radioButton2.getLabel();
	    lbl3 = button.getLabel();
	    text = Integer.parseInt(numgen_field.getText());
	    r3_text.setText(String.valueOf(text));
	    if (text >= 0)
	    {
	        if (lbl3 == lbl1) // zonder
	        {
	            int i;
				i = Integer.parseInt(r6_text.getText());
				do
	            {
	                i = Integer.parseInt(r6_text.getText());
	                i = i - 1;
	                r6_text.setText(String.valueOf(i));
	                int deur0;
	                int deur1;
	                int deur2;
	                int ran;
	                Random randomDeur = new Random();
		            deur0 = randomDeur.nextInt(2);
		            if (deur0 == 0)
		            {
		                deur1 = 1;
		                deur2 = 1;
		            }
		            else
		            {
		                deur1 = randomDeur.nextInt(2);
		                if (deur1 == 0)
		                {
		                    deur0 = 1;
		                    deur2 = 1;
		                }
		                else
		                {
		                    deur0 = 1;
		                    deur1 = 1;
		                    deur2 = 0;
		                }
		            }
		            ran = deur1 = randomDeur.nextInt(3);
		            if (ran == 0)
		            {
		                if (deur0 == 0)
		                {
		                    //won = won + 1;
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    //lost = lost + 1;
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
		            else if (ran == 1)
		            {
		                if (deur1 == 0)
		                {
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
		            else if (ran == 2)
		            {
		                if (deur2 == 0)
		                {
		                    won = Integer.parseInt(r4_text.getText());
		                    won = won + 1;
		                    r4_text.setText(String.valueOf(won));
		                }
		                else
		                {
		                    lost = Integer.parseInt(r5_text.getText());
		                    lost = lost + 1;
		                    r5_text.setText(String.valueOf(lost));
		                }
		            }
	            }
	            while (Integer.parseInt(r6_text.getText()) > 0);
	        }
	        else if (lbl3 == lbl2) // met
	        {
	            
	        }
	        generate2_button.setVisible(false);
	        numgen_text.setVisible(false);
	        numgen_field.setVisible(false);
	        radioButton1.setVisible(false);
	        radioButton2.setVisible(false);
	        lost_field.setVisible(true);
	        won_field.setVisible(true);
	        label1.setVisible(true);
	        label2.setVisible(true);
	        again_button.setVisible(true);
	        won = Integer.parseInt(r4_text.getText());
	        lost = Integer.parseInt(r5_text.getText());
	        won_field.setText(String.valueOf(won));
	        lost_field.setText(String.valueOf(lost));
	        
	    }
	    else
	    {
	        // to do
	        setBackground(java.awt.Color.yellow);
	    }
	}

	class SymItem implements java.awt.event.ItemListener
	{
		public void itemStateChanged(java.awt.event.ItemEvent event)
		{
			Object object = event.getSource();
			if (object == radioButton2)
				radioButton2_ItemStateChanged(event);
			else if (object == radioButton1)
				radioButton1_ItemStateChanged(event);
		}
	}

	void radioButton2_ItemStateChanged(java.awt.event.ItemEvent event)
	{
		r2_text.setText("1");
		r1_text.setText("0");
			 
	}

	void radioButton1_ItemStateChanged(java.awt.event.ItemEvent event)
	{
		r2_text.setText("0");
	    r1_text.setText("1");
	}

	class SymText implements java.awt.event.TextListener
	{
		public void textValueChanged(java.awt.event.TextEvent event)
		{
			Object object = event.getSource();
			if (object == numgen_field)
				numgenField_TextValueChanged(event);
		}
	}

	void numgenField_TextValueChanged(java.awt.event.TextEvent event)
	{
		// to do: code goes here.
			 
	}
}
Thanks for helping!

Hans.