Results 1 to 5 of 5
  1. #1
    2potatocakes is offline Member
    Join Date
    Sep 2008
    Posts
    43
    Rep Power
    0

    Default Problems executing jar file outside of netbeans

    Hi guys,

    I've spent the last couple of days trying to build my java application so that it will run in windows but am getting a different result outside of Netbeans to when I run it inside.

    Basically I have a dozen or so class files with 1 main class file that executes my GUI. Inside netbeans it displays fine and all of my functionality works as well but when I build the file and then run it outside of netbeans the GUI is kind of all over the place. I'm 90% sure my manifest file and the build file is all correct, I've gone over it a dozen times.

    To be honest, I have 3 main elements but there dimensions seemed to be all screwed up? Any ideas what I can do to fix this easily or should I go in and manually enter all the heights and widths etc??

    <code>
    panel.setLayout(null);
    panel.add(mainOutput);
    panel.add(userID);
    panel.add(idLabel);
    Insets insets = panel.getInsets();
    Dimension size = mainOutput.getPreferredSize();
    mainOutput.setBounds(180 + insets.left, 140 + insets.top,
    size.width, size.height);
    size = userID.getPreferredSize();
    userID.setBounds(620 + insets.left, 125 + insets.top,
    size.width, size.height);
    size = idLabel.getPreferredSize();
    idLabel.setBounds(515 + insets.left, 125 + insets.top,
    size.width, size.height);
    </code>

  2. #2
    2potatocakes is offline Member
    Join Date
    Sep 2008
    Posts
    43
    Rep Power
    0

    Default

    Actually its more than just the display, I just changed the heights and widths manually and tried a calculation and its thrown up all sorts of errors.

    How come I'm getting errors here and not in netbeans?? :(

  3. #3
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Location
    Pennsylvania, USA
    Posts
    136
    Rep Power
    0

    Default

    I am not 100% sure, but it might be because of your layout mgr being null... Try looking at one of these to see if they work better...

    Also can you post some code and your errors...
    Who Cares... As Long As It Works...

  4. #4
    2potatocakes is offline Member
    Join Date
    Sep 2008
    Posts
    43
    Rep Power
    0

    Default

    :) thanks, sorry, I posted up that wrong bit. Its definately more than just the display. That null part was just so I could do absolute positioning with those other elements and I thought that was it at first.

    I'm wondering if it is something to do with the way I am building it in netbeans, or if there is something I haven't configured properly?

    Here is the program running in netbeans:



    And then when I try and run the Jar file from windows:

  5. #5
    markw8500's Avatar
    markw8500 is offline Senior Member
    Join Date
    Jul 2008
    Location
    Pennsylvania, USA
    Posts
    136
    Rep Power
    0

    Default

    I see... Are you using any external resources... Images, jars, files,etc... It could be that your app can not find them and it blows up...
    Who Cares... As Long As It Works...

Similar Threads

  1. Executing a jar file
    By peiceonly in forum New To Java
    Replies: 7
    Last Post: 02-14-2014, 09:02 AM
  2. Executing JAR File by double clicking
    By jasmu in forum Advanced Java
    Replies: 11
    Last Post: 04-22-2009, 12:51 PM
  3. Replies: 2
    Last Post: 02-10-2009, 02:37 PM
  4. [SOLVED] Error executing Jar file
    By VeasMKII in forum New To Java
    Replies: 3
    Last Post: 01-31-2009, 05:32 AM
  5. executing the java file
    By TheBayWatchMan in forum New To Java
    Replies: 4
    Last Post: 01-12-2008, 09:31 AM

Posting Permissions

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