• Post Reply Bookmark Topic Watch Topic
  • New Topic

Showing DOS job in a JTextPane

 
Barry Brashear
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to kick off a bat file from a Java swing program and have the
dos output show in a JTextPane?

Thanks.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's possible. You can call Runtime.exec to execute CLI tasks, and it will return to you a Process object, through which you can get access to the input, error and output streams of the newly created process. A few points to keep in mind when using Runtime.exec can be found here.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!