posted 16 years ago
You can try adding Listeners to your text fields, but that doesn't sound at all like good programming to me. Nor does enabling and disabling buttons depending on whether text is being added or deleted sound good to me.
If you have an empty text field, or text which doesn't match an e-mail address (do a search through JavaRanch for regular expressions for e-mail addresses, which can be very long), you have various options from your button:
Throw Exception.Pop up JOptionPane.Delete text.