Hey everyone,
I’m trying to chance the key when a certain key is pressed with the following code:
private void keyDownEvent(KeyDownEvent e, TextField textField){
Key key =e.getCode().get();
Key key2 = e.getKey();
if(key.equals(Key.SPACE)){Key.SPACE.
numberField.setValue(textField.getValue()+",");
//method doesn't exist..
e.setkey
}
}
Unfortunately more things are going wrong here. The if is never true, it doesn’t matter if I use the key or key2 variable here.
Then there is the thing of change the character that’s being added to as tring somewhere. (could also be in the middle of the string…).
Does anyone know how to handle this?
Kind regards,