Hi all.
I've setup an actionistener on some JTextFields so that I can perform mathematical calculations on them. Basically, how do I stop text being actioned?
What I would like is that if the user enters text, then do nothing.
My code for the action listener is:
public void actionPerformed(ActionEvent event)
{
String string1 = text1.getText(); //Assign value of textbox to the string
int counter = Integer.parseInt( string1 ); //Convert to integer
.
.
.
.
}
Is there some way of saying if Text1 = texttype then do nothing? i.e. dont try and calculate?