File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hiding DOS console w/GUI app.

 
Regus Patoff
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1492
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Regus Patoff
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys!
Both ways worked great. People like you help make these forums (fora?) excellent resources for all of us.
Reg
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic