• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Save output of command prompt in JTextarea.

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic