I want a reliable way to get the entered text by the user as a String for further use. I do not want to use a spefcific input text field though. Using the normal KeyListener() would problably be a possibility but that is not what I want. A text input field would be unsuitable for my usecase.
I do not have any code examples, because I dont have any idea, how to taccle the problem. I do not want to use the KeyListener because it does not provide a reliable way to see wether the user has stopped writing. And each key has to be programmed on its own or is it just my way of using the listener inpropally?
public void keyPressed(KeyEvent e) {
if (code == KeyEvent.VK_W){
upPressed = true;
}
}
public void keyReleased(KeyEvent e) {
if (code == KeyEvent.VK_W){
upPressed = false;
}
}
and the text input fields can not be styled (if they can, I do not know how!)