You have the try/catch in the wrong place. You need to put it inside the actionPerformed method.
public void actionPerformed(ActionEvent e ) {
try {
int a = Integer.parseInt( t1.getText() );
}
catch(NumberFormatException e ) {
System.out.println( e.getMessage() );
}
}