Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

launching an application from swing button  RSS feed

 
Jane Dunne
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I want to launch an executable when the user clicks on a swing button but am not sure of how to do this. Any ideas?

Thanks.
 
Tal Nathan Tal Nathan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.lang.Runtime;


String cmd = "cmd /c notepad.exe"
Runtime.getRuntime().exec(cmd);

Havent tested this, but it should do the trick.
 
Jane Dunne
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's it. Thanks alot!
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!