Forums Register Login

To run a swing application in window system

+Pie Number of slices to send: Send
How can I put a shortcut on desktop in order to run my application(6 classes)when I click it?
+Pie Number of slices to send: Send
Hi Glen,

Two ways I can think to do this.

1) create an executable jar file of the application and then put that on the desktop

2) create a batch file (assuming windows) with the relevant java command to run your application in it and put that on the desktop
+Pie Number of slices to send: Send
hi guys
the batch file wont block on the
first program and wait for it to exit !!?
i think it does.
+Pie Number of slices to send: Send
That's no problem though. I'm assume the 6 classes mentioned form 1 application, not 6 separate ones? Just call java on the main class in the batch file. Side-effect is that you are left with a command window open while the program is running.
+Pie Number of slices to send: Send
right click the class file(the one with main()) - select sendto/desktop/create shortcut
right click the shortcut - select properties
look for 'Target'
eg in Target it may be
"C:\Documents and Settings\Java\Testing.class"

change this to
javaw -classpath "C:\Documents and Settings\Java" Testing

(note the 'space' before and after -classpath and before Testing)
(windows will add the extra stuff it needs)
+Pie Number of slices to send: Send
Thanks guys, big help!

glen
+Pie Number of slices to send: Send
Thanks guys, big help!

glen
Quick! Before anybody notices! Cover it up with 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 1151 times.
Similar Threads
View cannot be restored exception
J2EE begineer
Deploy JBoss Application to WAS
J2EE and EJB on SDK
Not able run mysql based jdbc program
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:44:12.