I have been wondering if it is possible to update JFrame or JDialogs based on the inputs inside jtextarea without button click. For an example, after i input some text in textarea. it should automatically update jlabel without the need of a button. I have search troughout but all the information i found is only based on button click . For an example ,
JFrame frame = new JFrame();
frame.setLayout(new GridLayout(0, 1));
JTextArea input = new JTextArea();
JLabel output = new JLabel("test");
// Condition
// If user input "abc" inside textfield
// JLabel will automatically display "abc"
frame.add(input);
frame.add(output);
frame.setSize(300,400);
frame.setVisible(true);
Do i need to refresh the entire frame ? will it affect all the other textfield that user have already fill back to empty?
Thanks