I'm having problems with my code regarding the value of the string I get with the JTextfield.getText() method
my code goes this way:
(keypressedevent evt){
int id=evt.getId();
char c = evt.getKeyChar;
String s = JTextField.getText()+c;
System.out.print(s);
}
if the textfield contains for example: apple
and you type s, it will print apples.
but if you pressed backspace, it would still print apples
it wouldn't update until you press another key.
Is there a way to get the desired output here?
Thanks in advance!