aspose file tools*
The moose likes I/O and Streams and the fly likes Keypressing on console or Dos prompt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Keypressing on console or Dos prompt" Watch "Keypressing on console or Dos prompt" New topic
Author

Keypressing on console or Dos prompt

Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
anyone remember the Dos prompt and the inscription "Press enter to continue... "

so... i want to control the pressing of the button "Enter" on Dos Prompt. How to do this.
It's pretty easy to do this on a JFrame, but how to do it on dos or console?
Kamesh Loganathan
Greenhorn

Joined: Jan 21, 2006
Posts: 20
Hi Pal,
I think the best way to do this is using win32 API's.
If you are bent on using java, write a dll and call it
from java.
Antony Amicone
Ranch Hand

Joined: Mar 11, 2006
Posts: 125
i'm a beginner is really too difficoult this to me. Is there a simplest way? i only need to make and if that control if enter is pressed on console or dos prompt
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Have you worked out how to read input from the console? You can wrap a reader around System.in and readln(). That will require the user to hit the enter key to continue.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Christopher Robinson
Greenhorn

Joined: Apr 15, 2006
Posts: 7
Two choices. For the simple "press enter to continue," you can just read a byte from System.in:However, for more complicated stuff, I'm lead to believe there's a Java-based ncurses implementation. I don't know if this will include support for DOS terminals.


Twey
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Keypressing on console or Dos prompt
 
Similar Threads
Urgent! Hide Tomcat console and run it in NT services
How to enter password on DOS prompt !
Error - ; expected
Javac compiler won't start!! can't compile any code
how to clear console in java ?