Perhaps this is a stupid question. If you use the usual way to start a Swing GUI
public static void main(String[] args) { invokeLater(new Runnable() { public void run() { // etc. } }); }
then (at least in Windows), if you start this with a .bat file, you still see an extra console window. If you close that window, then the Swing GUI goes away, too. How can i start 'just the Swing GUI'?
> Perhaps this is a stupid question. > If you use the usual way to start a Swing GUI
> public static void main(String[] args) { > invokeLater(new Runnable() { > public void run() { // etc. > } > }); > }
> then (at least in Windows), if you start this with a .bat file, you still > see an extra console window. If you close that window, then the Swing GUI > goes away, too. How can i start 'just the Swing GUI'?
> > Perhaps this is a stupid question. > > If you use the usual way to start a Swing GUI
> > public static void main(String[] args) { > > invokeLater(new Runnable() { > > public void run() { // etc. > > } > > }); > > }
> > then (at least in Windows), if you start this with a .bat file, you still > > see an extra console window. If you close that window, then the Swing GUI > > goes away, too. How can i start 'just the Swing GUI'?
> use javaw insead of java.
And use the dos START /B command in the bat file if necessary, you need to on Win2000, as even with javaw the console window remains.
> And use the dos START /B command in the bat file if necessary, you need to > on Win2000, as even with javaw the console window remains.
Isn't that only when you actually use "start javaw SomeClass" ?
I'd expect not to see a console window on Win2000, when you start an application with "javaw SomeClass". That's the behaviour I'm used to on my Win2000 machines.
jcsnippets.atspace.com wrote: > "VisionSet" <s...@ntlworld.com> wrote in message > news:j1Ibg.3452$Mm3.1792@newsfe6-win.ntli.net... > <snipped> >> And use the dos START /B command in the bat file if necessary, you need to >> on Win2000, as even with javaw the console window remains.
> Isn't that only when you actually use "start javaw SomeClass" ?
> I'd expect not to see a console window on Win2000, when you start an > application with "javaw SomeClass". That's the behaviour I'm used to on my > Win2000 machines.
It's not javaw that opens/maintains the console window VisionSet mentions, but the cmd.exe interpreter. If a shortcut, rather than a batch file, is used to launch javaw TheClass, then as you suggest, the console window won't show up at all.
Jeffrey Schwab wrote: > jcsnippets.atspace.com wrote: >> "VisionSet" <s...@ntlworld.com> wrote in message >> news:j1Ibg.3452$Mm3.1792@newsfe6-win.ntli.net... >> <snipped> >>> And use the dos START /B command in the bat file if necessary, you >>> need to >>> on Win2000, as even with javaw the console window remains.
>> Isn't that only when you actually use "start javaw SomeClass" ?
>> I'd expect not to see a console window on Win2000, when you start an >> application with "javaw SomeClass". That's the behaviour I'm used to >> on my >> Win2000 machines.
> It's not javaw that opens/maintains the console window VisionSet > mentions, but the cmd.exe interpreter. If a shortcut, rather than a > batch file, is used to launch javaw TheClass, then as you suggest, the > console window won't show up at all.
Many thanks to all respondents! start /b javaw TheClass That did the trick. And using a shortcut works even nicer.
> Perhaps this is a stupid question. > If you use the usual way to start a Swing GUI
> public static void main(String[] args) { > invokeLater(new Runnable() { > public void run() { // etc. > } > }); > }
> then (at least in Windows), if you start this with a .bat file, you > still see an extra console window. If you close that window, then the > Swing GUI goes away, too. How can i start 'just the Swing GUI'?
Use webstart! Is an xml file with extension .jnlp. Then double click on the file and the application starts. In the same way you can insert a link to the jnlp file on an html page.