This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Save output of command prompt in JTextarea.  RSS feed

 
Siddharth Mitesh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
In my program i made 1 screen, in that i put 1 textarea and 1 button.
When user press that button i want to run ping command and its output i want in textarea.
How can i do that, give fast reply its urgent for me.
Thanx
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Siddharth,
This is not a simple task. The java Socket class does not allow low level access to the TCP/IP stack. You could use Runtime.exec () to run the ping command with a redirection of its output to a file, which you can then disect for results.
Some other rancher may have done this and might be prepared to post their code. However, be aware that this would be a platform dependent hack.
Ed
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!