Hi everyone!
I'm currently writing a program that creates objects upon keyboard input. The user should be able to change the apperance of these objects by typing into one or more TextFields and change variables like labels, size, colour etc...
I've created a TextField by:
Code:TextField inputLine = new TextField("Blahblah", 15);
add(inputLine);
in the setup().
Initially, the Object creation works fine.
But once you write into the TextField the TextField will obviously get the focus and "keyPressed()" will not be called anymore.
So I'm wondering what I have to do, to return the focus to the initial status, after something has been written into the TextField.
I've tried calling
Code: inputLine.setFocusable(false);
inputLine.setFocusable(true);
right after each other...
But while the TextField looses it's focus, it doesn't seem like the Programm regains it, because "keyPressed()" still doesn't work.
And by the way, is there an easy way to arrange the TextFields on the screen (and change their apperance)?
I wouldn't exactly be thrilled if I had to write my own TextField class for that...
Anyways, thanks in advance!