File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Keyboard events without GUI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Keyboard events without GUI" Watch "Keyboard events without GUI" New topic

Keyboard events without GUI

vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
hi, is there a way to accept input from user without using any GUI interface? My program will take in the key typed by user then responds according to the key typed. All this will be done in Command Prompt and run from JAR file.

I'm not available, my BF's name is WORK.
marc weber

Joined: Aug 31, 2004
Posts: 11343

Have you looked at the java.util.Scanner class?

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
vivien siu
Ranch Hand

Joined: Nov 10, 2005
Posts: 143
yups, using the for the constructor argument. Thanks
I agree. Here's the link:
subject: Keyboard events without GUI
It's not a secret anymore!