Problem with timers

Hello,

I am writing a program that uses multiple timers. I need a ActionPerformed command to differentiate the timer events. My code is below.

import java.util.Vector;
import java.awt.;
import java.awt.event.
;
import javax.swing.;
import java.io.
;
import java.awt.BorderLayout;
import java.awt.FlowLayout; import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JTextField;
import java.util.Formatter;
import java.util.Random;

//import java.util.*;

public class DataEntry extends JFrame implements FocusListener,KeyListener,ActionListener
{
private JLabel label1;
private JLabel label2;
private JLabel label3;
private JLabel label4;
private JLabel label5;
private JLabel label6;
private JPanel Panel1;
private JPanel Panel2;
private JPanel Panel3;

private JTextField textField1;
private JTextField textField2;
private JTextField textField3;
private BorderLayout layout;
private GridLayout gridLayout1;
private FlowLayout flowLayout1;

Timer timerSec=new Timer(10000,this);
Timer timerMin=new Timer(60000,this);
//Timer timer3Min=new Timer(18000,this);
private String a;
private String b;
private String c;
private String d;
private String l;
private String yy;
private int f;
private int v;
private int x;

private int z;
private int n;
private float m=0;
private int correct=0;
private int array[]=new int[12];
private int incorrect=0;
private int counter2=-1;

Formatter formatter=new Formatter();
Formatter formatter2=new Formatter();
Formatter formatter3=new Formatter();
Formatter formatter4=new Formatter();

public DataEntry()
{
	super("Data Entry");

	layout = new BorderLayout(5,10);
    timerSec.start();
    timerMin.start();
    //timer3Min.start();
	flowLayout1= new FlowLayout();
	setLayout(layout);
	Panel1 = new JPanel();
	Panel2=new JPanel();
	Panel3=new JPanel();
	Random randomNumber=new Random();

	for(int counter=0;counter<array.length;counter++){

        array[counter]=randomNumber.nextInt(10);

	    }



    formatter.format("%d%d%d%d",array[0],array[1],array[2],array[3]);
	formatter2.format("%d%d%d%d",array[4],array[5],array[6],array[7]);
	formatter3.format("%d%d%d%d",array[8],array[9],array[10],array[11]);
	//d=String.valueOf(z);
	label1=new JLabel(formatter.toString());
	label2=new JLabel(formatter2.toString());
	label3=new JLabel(formatter3.toString());
	label4=new JLabel("");
	label5=new JLabel("");
	label6=new JLabel("");

	add(Panel1,BorderLayout.NORTH);
	Panel1.setLayout(flowLayout1);
	Panel1.add(label1);
	Panel1.add(label2);
	Panel1.add(label3);

	add(Panel2,BorderLayout.SOUTH);
	textField2=new JTextField(4);
	textField3=new JTextField(4);
	textField1=new JTextField(4);
	textField1.addFocusListener(this);
	textField3.addFocusListener(this);
	textField2.addFocusListener(this);
    textField1.setName("David");
    textField1.addKeyListener(this);
    textField2.addKeyListener(this);
    textField3.addKeyListener(this);
    textField2.setName("John");
    textField3.setName("Roger");

	Panel2.add(textField1);
	Panel2.add(textField2);
	Panel2.add(textField3);

	add(Panel3,BorderLayout.CENTER);
	Panel3.setLayout(flowLayout1);
	Panel3.add(label4);
	Panel3.add(label5);
	Panel3.add(label6);



}

public void focusGained(FocusEvent e) {
System.out.println(“focusGained”);
if(e.getComponent() instanceof JTextField) {
JTextField jTextField = (JTextField) e.getComponent();
if(jTextField.getName() != null && jTextField.getName().equals(“David”)) {
label4.setText(formatter.toString());
}
if(jTextField.getName() != null && jTextField.getName().equals(“John”)) {
label4.setText(formatter2.toString());
}
if(jTextField.getName() != null && jTextField.getName().equals(“Roger”)) {
label4.setText(formatter3.toString());
}

}

}

public void focusLost(FocusEvent e) {

}


public void keyTyped(KeyEvent e) {
    l=String.format("%s",e.getKeyChar());
    counter2++;

    b=String.valueOf(array[counter2]);


    	if(l.equals(b)){
    		correct++;
            System.out.printf("Correct:%d\

Incorrect:%d
",correct,incorrect);
}

        else  {
			incorrect++;
			System.out.printf("Correct:%d\

Incorrect:%d
",correct,incorrect);

	    }


        f++;
        if(f==4){
			textField2.requestFocus();

			}
		if(f==8){
			textField3.requestFocus();
		}
		if(f==12){
			f=0;
			textField1.requestFocus();
			m=((float)correct/12)*100;
			System.out.printf("%.2f",m);
			formatter4.format("%.2f",m);

			if(m==0){

				yy=String.valueOf(m);
				label5.setText(yy);
		    }
            else{
				//yy=String.valueOf(m);
                label5.setText(formatter4.toString());
		    }
		}

    }
    /** Handle the key-pressed event from the text field. */
public void keyPressed(KeyEvent e) {


}

/** Handle the key-released event from the text field. */
public void keyReleased(KeyEvent e) {

}


public void actionPerformed(ActionEvent event)
{
	//String arg = event.getActionCommand();
	if(event.getActionCommand()==1)
	{
		System.out.print("Sec stop");
		timerSec.stop();
    }
    if(event.getActionCommand()==2)
    {
		System.out.print("Min stop");
		timerMin.stop();
    }



}

}

And what is the problem exactly?

The problem is that I want the minute timer to do one thing when it fires and the second timer to do another. I tried using setname on the timers but that didn’t work. I also tried using a string or number after the timer such as timerMin.start(“Minute”) or timerMin.start(1).