I am trying to write a simple program where i want it to check that if
the space bar is pressed, then it prints out something. I was thinking it would be "if(keypressed == Spacebar)" but i cant seem to figure it out. I dont want to use Java.awt or a key listener, just be simple.
Without a GUI library such as Swing, how do you propose to respond to a key?
Originally Posted by mustachMan
Yeah, the main thread of a non-gui app doesn't respond to events. It'd actually be a lot more work to write something to do that without using Swing.