Results 1 to 2 of 2

Thread: Control a command line program in Java

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2004
    Posts
    8

    Control a command line program in Java

    Could someone point me in the right direction on how to Use java to controll a comand line program. I want to create a GUI that is a wrapper for a command line program that I have but I can not find out how to redirect the inputs and outputs. Thanks ahead of time!

  2. #2
    New Member njadams's Avatar
    Join Date
    Jun 2004
    Location
    Derby, UK
    Posts
    11
    If you load the command line program with Runtime.exec() you will be returned a Process object.

    This Process object allows you to redirect the input and output from the process.

    Use this redirection in your gui, to send text to the application and to retrieve its out put for display in you gui as well
    Life is too short for chess!

    http://monkeynick.blogspot.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width