my dog learned polymorphism
The moose likes Java in General and the fly likes Blocking user input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Blocking user input" Watch "Blocking user input" New topic

Blocking user input

sandeep kapse

Joined: Jun 07, 2007
Posts: 25
Hi All,

I have developed custom shell in java. It is used to execute some commands. It works like this:
User types command on the prompt, then it press "Enter" to execute it.
Command then executes and displays output on the shell and shell prompt is displayed to accept another command.
Just like normal shell.

Here the problem is, after user press "Enter" key to run command, the command takes some time to execute, in mean time if user types anything on console, it is displayed on the console. I don't want this to happen. How should I block user input while command is executing?

Any help is really appreciated! Thanks.


I agree. Here's the link:
subject: Blocking user input
It's not a secret anymore!