This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Hiding DOS console w/GUI app. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Hiding DOS console w/GUI app." Watch "Hiding DOS console w/GUI app." New topic
Author

Hiding DOS console w/GUI app.

Regus Patoff
Greenhorn

Joined: Oct 30, 2001
Posts: 8
Hi,
I would like to know how to run a Swing application in Windows (any flavor), without that ugly DOS console window in the background. It would be great if I could also create a shortcut to the application.
Thanks,
RP
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Regus,
Simply put the following line into any *.bat file and create a desktop shortcut to it and you are all set. The console window will appear and disappear quickly while your program is loading.
Runner.bat:
@javaw SomeProgram
where SomeProgram is a compiled class file in the current directory.
Regards,
Manfred.
ryan headley
Ranch Hand

Joined: Jun 28, 2000
Posts: 156
Here's another neat way to do it.
Create a shortuct for it with this as the target:

THEN, in the Start In field add the path to the directory where your classfile is such as:
c:\apps\javapps\myprogram
If that doesn't work for some reason, what I've done is modified the target have the javaw.exe -classpath c:\apps\javapps\myprogram.
Its nifty, no batch files, no dos windows, etc....


Ryan Headley<br /><a href="http://www.sudovi.com" target="_blank" rel="nofollow">http://www.sudovi.com</a>
Regus Patoff
Greenhorn

Joined: Oct 30, 2001
Posts: 8
Thanks guys!
Both ways worked great. People like you help make these forums (fora?) excellent resources for all of us.
Reg
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Hiding DOS console w/GUI app.
 
Similar Threads
standard output screen
Urgent! Hide Tomcat console and run it in NT services
Console app on the web
installing applications from dos console.
bary ellert