Strange JMenuBar problem

B

bucky.pope

I've been developing with Eclipse Europa. I have a dialog with a
JMenuBar. When I test under Eclipse, the menu items are visible on the
bar. However, when I generate a jar file, the menu items are no longer
visible -- but the menu items are there because if I click in the
right spot, I get the correct response.

This has worked in the past. About a week ago, I created another jar
that I distributed which had no problems for me or my testers. I have
menus on other frames that work with no problem.

I've tried different jre's and compatibility settings. I've tried
changing the opacity of the menu items and the menu bar. I've tried
setting the foreground on the menu items. None of this works.

What's strange is executing under Eclipse works fine, generating a jar
does not. Everything else in the application seems to be working fine.

Any ideas about what could be different when executing from Eclipse
and from a jar?
 
S

Stefan Rybacki

bucky.pope said:
I've been developing with Eclipse Europa. I have a dialog with a
JMenuBar. When I test under Eclipse, the menu items are visible on the
bar. However, when I generate a jar file, the menu items are no longer
visible -- but the menu items are there because if I click in the
right spot, I get the correct response.

This has worked in the past. About a week ago, I created another jar
that I distributed which had no problems for me or my testers. I have
menus on other frames that work with no problem.

I've tried different jre's and compatibility settings. I've tried
changing the opacity of the menu items and the menu bar. I've tried
setting the foreground on the menu items. None of this works.

What's strange is executing under Eclipse works fine, generating a jar
does not. Everything else in the application seems to be working fine.

Any ideas about what could be different when executing from Eclipse
and from a jar?

My guess, there is an Exception thrown somewhere. Open the java console while
running/starting the jar and see whether you get an Exception.
 
S

softwarepearls_com

I've been developing with Eclipse Europa. I have a dialog with a
JMenuBar. When I test under Eclipse, the menu items are visible on the
bar. However, when I generate a jar file, the menu items are no longer
visible -- but the menu items are there because if I click in the
right spot, I get the correct response.

This has worked in the past. About a week ago, I created another jar
that I distributed which had no problems for me or my testers. I have
menus on other frames that work with no problem.

I've tried different jre's and compatibility settings. I've tried
changing the opacity of the menu items and the menu bar. I've tried
setting the foreground on the menu items. None of this works.

What's strange is executing under Eclipse works fine, generating a jar
does not. Everything else in the application seems to be working fine.

Any ideas about what could be different when executing from Eclipse
and from a jar?

Does any logic retrieve any resources from the JAR(s)? If so, then
that may be the point of failure.

For things like this, liberally sprinkling your code with asserts can
be a real time saver.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top