I have a button and a JTextField and if the JTextField is empty a message window opens informing that the field is empty. Now I want when I enter a number inside the JTextField, the text on the button to change. But I don't know which code to use.
I used this code
tfInputTinter.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
btObserving.setText("Stop Observing");
}
});
but nothing happens with the text on the button. Does anybody have an idea what should I do? Thanks