Java equivalent to C# TextBox TextChanged event
in C# there is an event for textboxes as follows private void fooText_TextChanged(object sender, EventArgs e) { //do something } the code in the fooText_TextChanged is fired once the text within the textbox is altered. What is the java equivalent to this? Or how can something similar to this be achieved in java? Thanks for any feedback/help/advice. For Swing, If you wanted to be notified after the text component's text had changed, you'd use a DocumentListener that was added to the JTextComponent's Document. e.g., JTextField myField = new JTextField(); myField.getDocument().addDocumentListener