Results 1 to 6 of 6
  1. #1
    oinca is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default 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.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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.

  3. #3
    oinca is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default 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.
    Last edited by oinca; 12-29-2011 at 11:24 AM.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Runnable Jar Export cant make more than one JFrame

    Quote Originally Posted by oinca View Post
    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.

  5. #5
    oinca is offline Member
    Join Date
    Aug 2011
    Posts
    6
    Rep Power
    0

    Default 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!

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default 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!

Similar Threads

  1. how to make a loading bar in jframe
    By arunkumarinfo in forum NetBeans
    Replies: 3
    Last Post: 12-28-2013, 05:45 PM
  2. Can not make a runnable jar of my project
    By liran in forum Advanced Java
    Replies: 5
    Last Post: 05-18-2010, 11:25 AM
  3. How to make a runnable jar with necessary libraries
    By Atriamax in forum New To Java
    Replies: 2
    Last Post: 10-27-2009, 10:36 PM
  4. Java: Make runnable java-file
    By MrBambey in forum New To Java
    Replies: 4
    Last Post: 08-10-2009, 06:40 AM
  5. Replies: 4
    Last Post: 04-22-2009, 11:02 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •