Hiding default console in Windows  
Author Message
Randolf Richardson





PostPosted: 2007-1-20 1:38:00 Top

java-programmer, Hiding default console in Windows Hello. Is it possible to hide the default console window in MS-Windows
in Java? If so, how?

When writing a Swing/JFC application in Java, it would be really nice to
somehow hide the DOS window that appears.

Thanks in advance.

--
Randolf Richardson - kingpin+email***@***.com
The Lumber Cartel, local 42 (Canadian branch)
http://www.lumbercartel.ca/
 
Thomas Kellerer





PostPosted: 2007-1-20 1:43:00 Top

java-programmer >> Hiding default console in Windows On 19.01.2007 18:38 Randolf Richardson wrote:
> Hello. Is it possible to hide the default console window in
> MS-Windows in Java? If so, how?
>
> When writing a Swing/JFC application in Java, it would be really
> nice to somehow hide the DOS window that appears.
>
> Thanks in advance.
>
Use javaw instead of java

And search google ;)

There are a lot of hints regarding this
 
lee





PostPosted: 2007-1-20 5:56:00 Top

java-programmer >> Hiding default console in Windows In article <email***@***.com>, "Randolf Richardson" <kingpin+email***@***.com> wrote:
> Hello. Is it possible to hide the default console window in MS-Windows
>
>in Java? If so, how?
>
> When writing a Swing/JFC application in Java, it would be really nice
> to
>somehow hide the DOS window that appears.
>
> Thanks in advance.
>

When you package your application in an executable JAR file, and double-click
it to start the program, Windows will start the program with javaw.exe instead
of java.exe. javaw does not show a console screen.

Lee Weiner
lee AT leeweiner DOT org
 
 
Andrew Thompson





PostPosted: 2007-1-20 9:45:00 Top

java-programmer >> Hiding default console in Windows Lee Weiner wrote:
....
> When you package your application in an executable ...

(by adding a manifest file identifying the main class)

>...JAR file, and double-click
> it to start the program, Windows will start the program with javaw.exe instead
> of java.exe. javaw does not show a console screen.

Another way to go is..
- package app. in any old jar. (no manifest needed)
- (sign the jar - if the project can not work in a sandbox) and
- launch using web start.

Web start (JWS) gives the user even better options (launch
via. desktop icon or menu item) and provides for automatic
updates, amongst other things.

Perhaps it is a little beyond your needs for the moment,
but it is worth considering for future projects.

Andrew T.

 
 
Randolf Richardson





PostPosted: 2007-1-20 15:13:00 Top

java-programmer >> Hiding default console in Windows On Fri, 19 Jan 2007 09:43:11 -0800, Thomas Kellerer
<email***@***.com> wrote:

> On 19.01.2007 18:38 Randolf Richardson wrote:
>> Hello. Is it possible to hide the default console window in
>> MS-Windows in Java? If so, how?
>> When writing a Swing/JFC application in Java, it would be really
>> nice to somehow hide the DOS window that appears.
>> Thanks in advance.
>>
> Use javaw instead of java

Thanks to you and Lee for this suggestion.

> And search google ;)

I did that, which is why I asked here.

> There are a lot of hints regarding this

I'll do some experimentation as well. Thanks.

--
Randolf Richardson - kingpin+email***@***.com
The Lumber Cartel, local 42 (Canadian branch)
http://www.lumbercartel.ca/