Runnable Jar Export cant make more than one JFrame
Hi, i made a Fat Jar export from my project on wich i implemented a Mainframe and a Login frame (both JFrame Objects) the thing is that it will only show the Mainframe, i tested on Eclipse's enviroment without any trouble. I'm thinking on running the login frame on another Thread just in case...any thoughts?
P/S: The login frame is set to be located relative to the Mainframe and to be allways on top. In any other aspect is just a regular frame.
Re: Runnable Jar Export cant make more than one JFrame
Suggestions:
- Do not run one Swing component in another thread. All Swing code must be run on a single thread, the Swing event dispatch thread or EDT.
- Your second window (the login window) is behaving as a modal dialog and in fact should be a modal JDialog, not a JFrame. I suggest that you make this change.
- I don't think we can tell you why you're not seeing the second window from the jar file based on the information that you've presented so far.
Re: Runnable Jar Export cant make more than one JFrame
Hi Fubarable, the code is to extense to post it, my concern mainly lies on why in Eclipse's enviroment runs fine and as a portable app doesnt...however i tried your suggestion about making the login view a JDialog and the result remains the same.
Re: Runnable Jar Export cant make more than one JFrame
Quote:
Originally Posted by
oinca
Hi Fubarable, the code is to extense to post it, my concern mainly lies on why in Eclipse's enviroment runs fine and as a portable app doesnt...however i tried your suggestion about making the login view a JDialog and the result remains the same.
Then you've got a bug somewhere. Consider creating and posting an SSCCE which I think would offer the best and quickest way that we could help you well.
Re: Runnable Jar Export cant make more than one JFrame
Hi again, i found the problem...the thing is that once it was packed the program couldnt locate an embedded image resource because FatJar doesnt pack it unless its placed inside a package . On the other hand as it was itself (the program) wrapped as an .exe file i couldnt see the java console and the Exception rise...looking back i can say now that at the moment of the exception the Thread you mention before (EDT) stop at that time but didnt crash the program completely. Thanks for the attention Fubarable and happy new year!
Re: Runnable Jar Export cant make more than one JFrame
Glad you've figured it out -- and you did it on your own, congrats! Have a happy and healthy new year!