I've got a Window which contains a panel with some components, one of them is a textBox in which I type some input sent to a Socket stream.
I might want to exit the program and detect keys to make some alternate functions, like detecting scape and clossing the screen, but I've got the problem that if I try pollInput, my input won't go to the textBox anymore.
This is my function to poll the input :
public void checkKeys(){
Thread readKeys = new Thread(new Runnable() {
public void run() {
try {
while (true) {
keyStroke = screen.pollInput();
if (keyStroke != null && keyStroke.getKeyType() == KeyType.Escape) {
window.close();
System.exit(0); //exits the process
}
}
}catch(IOException e){
}
}
});
readKeys.start();
}
Hi,
I've got a Window which contains a panel with some components, one of them is a textBox in which I type some input sent to a Socket stream.
I might want to exit the program and detect keys to make some alternate functions, like detecting scape and clossing the screen, but I've got the problem that if I try pollInput, my input won't go to the textBox anymore.
This is my function to poll the input :
Any ideas?