Hai Rachel,
When I am using two getText() methods it is taking only the second value but not the first value. I am giving the code below.
public void actionPerformed(ActionEvent event) {
Object source = event.getSource();
if(source instanceof JTextField) {
txtField1 = (JTextField)event.getSource();
answer=(
String)MathPackage.matchAnsTxtField1.getText();
txtField2 = (JTextField)event.getSource();
answer = answer+(String)MathPackage.matchAnsTxtField2.getText();
}
}
Here answer is a string and txtField1 and txtField2 are the JTextField objects.