I wanted to try out using a KeyListener to read what key I press so it can paint a circle in my frame, but I can't get it to work, any suggestions?
Thanks for your help!
posted 1 year ago
The Keyboard class isn't used for anything - if you want to use it as a KeyListener you have to allocate an instance and set it as key listener on whatever component should listen to those key strokes.
Apart from that, why does the class extend JPanel if you are not using as a JPanel? Its paint method will not be called.