wood burning stoves 2.0*
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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 System.in for the constructor argument. Thanks
Consider Paul's rocket mass heater.
subject: Keyboard events without GUI
Similar Threads
Reading a file written by c++, or is there any other way?
Editable combobox events
Using Java How will u check key typed from the Keyboard is ESC key or not
how to give focus to a component ?
How to build a frame ?