posted 11 years ago
I coded an application where there is 2 textfields having keylistener and a submit button with action listener.
For key and action listener, here is the coding
public void keyPressed(KeyEvent e) {
Its working fine. If i put any value in currentPaymenttext in press enter, its works. Now, (without pressing PAY button), again i change the value in currentPaymenttext and press enter, its updated with new value.
But, when i submit the form through PAY button(ActionListener), the code inside runs twice. On little bit of research i found that the number of times i change the value inside currentPaymenttext textfield in press enter, those many times submit code (i.e the code inside )runs, thus saving the same thing inside db those many number of times,
What is the mistake here?