Forums Register Login

launching an application from swing button

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
import java.lang.Runtime;


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

Havent tested this, but it should do the trick.
+Pie Number of slices to send: Send
That's it. Thanks alot!
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 753 times.
Similar Threads
hi, please tell differences
Swing design possible to integrate with servlet
List of Patterns used in Java SE
My java swing application can not visible on linux
Redirecting of one frame to another frame
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:15:00.