I created a program that using the Robot class to output some text on my notepad.
public class Main extends Thread implements KeyListener {
public Main() {
addKeyListener(this);
...
}
I would like to stop it by clicking on a certain key, is it possible? I tried to implement it and add it but it's a compilation error.
My class is a sub-class of Thread.