File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes To Press Return on the Comman Prompt 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 "To Press Return on the Comman Prompt" Watch "To Press Return on the Comman Prompt" New topic
Author

To Press Return on the Comman Prompt

Sean Magee
Ranch Hand

Joined: Aug 23, 2004
Posts: 69
If I have a program that takes command words in through the command prompt.
Eventually I want to be able to implement a GUI that prints line in the command prompt, and then does the similar action as a user pressing return.
Everytime I try this, it prints the line, but it doesnt do the User Return function, so if another button prints a line, it wil just preint right after on the next line, without actually doing the "return"function.
Is this clear?
is this possible
?
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Sounds like what you want to do is pipe messages into System.in so that they can be read by the command prompt, yes? I've never tried that, but it doesn't sound like it's necessarily a good solution.

Why not just have the buttons call the methods that those command-line commands would trigger? That sounds a lot easier--you don't have to worry about parsing the command-line arguments and it's a lot safer from potential bugs.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: To Press Return on the Comman Prompt
 
Similar Threads
Head First - MiniMiniMusicCmdLine
path of db.db
JNI system call on Unix
cannot understand this code
JAR execution problems