-
June 30th, 2009, 08:31 AM
#1
problem launching JFrame build
Hello,
i've made a program that runs fine when i run it with netbeans (F6), but when i build the project and launch the application, one of the two main frames doesn't appear! Heres my Main code:
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Menu().setVisible(true);
}
});
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ToolBar().setVisible(true);
}
});
}
When I run the program with netbeans, both the toolbar and menu (who both extend from JFrame) appear, but when i build the .jar and launch it, only the toolbar appears. Any idea why this might happen???
thanks
Dave
PS.: if im not in the right forum, what forum should this go in?
edit: Im loading a dll from the jar, and it launches fine when i double-click on it, but when i launch from the console, an error says it cant find the dll and the program exits
-
June 30th, 2009, 09:25 AM
#2
Re: problem launching JFrame build
problem "solved"
for some reason the executable didn't like the absolute layout, so i changed it for a freeDesign... still no clue why, since it runs fine within netbeans:P
-
June 30th, 2009, 09:45 AM
#3
Re: problem launching JFrame build
What do you mean by absolute layout?
If this is the AbsoluteLayout class then this a Netbeans layout manager and not part of the standard jdk so you need to include the jar containing the AbsoluteLayout class.
If by free design you mean no layout manager then this is generally a mistake. The beauty of layout managers is if any of your components change size for example because you change a button or label's text then the components will be repositioned/resized so that they are still be laid out correctly. Also if the frame changes size either programatically or because the user drags the frame border with a layout manager the layout will change accordingly. However if you've created the layout using hard coded values then you'll have to change and recompile your code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|