hi
I compiled a 'hello world' style java app using Swing's JFrame, and when
packaging it into a .jar file, I got 'error - no main class found' when
running it. I quickly solved this by adding a manifest file specifying
"Main-class = helloworld"
and including this in the jar.
However when I use the (preferred?) method of using the
javax.SwingUtilities.InvokeLater method to 'make the event dispatching
thread' handle the form (which sounds like a good idea coming from a C#
background) the application won't run - but only when compiled into a jar.
It just cites 'exception in sub main' on the line calling the InvokeLater
method, and I can't glean what the cause of the exception is at all.
However it works when I don't compile it into a jar archive, which
suggests that the code is correct. The code is just any standard hello
world example that uses the invokeLater method in its createAndShowGui.
It seems weird that it will work fine *either* as a jar but with the
code altered so that the main directly is showing the form, *or* with the
event-dispatching invokeLater thingy and no jar... but not both.
Any suggestions?
John McGrath - 01 Mar 2005 16:03 GMT
> However when I use the (preferred?) method of using the
> javax.SwingUtilities.InvokeLater method to 'make the event dispatching
[quoted text clipped - 4 lines]
> It just cites 'exception in sub main' on the line calling the InvokeLater
> method, and I can't glean what the cause of the exception is at all.
Hmmmmm... No source code. No exception details.

Signature
Regards,
John McGrath
bonj - 03 Mar 2005 18:23 GMT
>> However when I use the (preferred?) method of using the
>> javax.SwingUtilities.InvokeLater method to 'make the event dispatching
[quoted text clipped - 6 lines]
>
> Hmmmmm... No source code. No exception details.
Hmm... I just typed it out, and it now works. A phantom error. Must have
been something I was doing in the extra code I had previously, but if
that's the case then I can build it up from what works.
Thanks