Results 1 to 5 of 5
- 04-29-2009, 07:53 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 43
- Rep Power
- 0
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>
- 04-29-2009, 08:00 PM #2
Member
- Join Date
- Sep 2008
- Posts
- 43
- Rep Power
- 0
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?? :(
- 04-29-2009, 08:03 PM #3
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...
- 04-29-2009, 08:41 PM #4
Member
- Join Date
- Sep 2008
- Posts
- 43
- Rep Power
- 0
:) 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:
- 04-29-2009, 09:53 PM #5
Similar Threads
-
Executing JAR File by double clicking
By jasmu in forum Advanced JavaReplies: 11Last Post: 04-22-2009, 12:51 PM -
Executing a java .class file from outside the containing folder
By mzatanoskas in forum New To JavaReplies: 2Last Post: 02-10-2009, 02:37 PM -
[SOLVED] Error executing Jar file
By VeasMKII in forum New To JavaReplies: 3Last Post: 01-31-2009, 05:32 AM -
executing the java file
By TheBayWatchMan in forum New To JavaReplies: 4Last Post: 01-12-2008, 09:31 AM -
Executing a jar file
By peiceonly in forum New To JavaReplies: 2Last Post: 04-06-2007, 02:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks