Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java Web Start useScreenMenuBar on Tiger



Jeff Martin <email@hidden> wrote:

>Yes, I made the call as the first line of my main() in my main class.
>
>I also tried it as a static initializer in my main class.

If your main class extends a Swing or AWT class, that relationship alone
can be enough to trigger the reading of the apple.laf.useScreenMenuBar
property.  Or if the main class has inner classes that reference some Swing
or AWT classes, the same thing may happen.  So by the time any methods
execute, even a static initializer in your main class, it's too late.

The first thing to happen is always class-loading, and that triggers other
things to happen, and eventually main() gets executed.  Static initializers
are executed bottom-up, not top-down.  So a static initializer in your main
class is probably some of the LAST code to execute of the cascade triggered
by loading your main class.  You need to postpone that whole cascade until
after apple.laf.useScreenMenuBar has been set.

Sometimes an "indirecting" main class that loads the other main class by
name works, using Class.forName() and a literal class-name string.  There
are a couple ways to go after that, such as reflection or casting to an
abstraction.  Reflection can be obtuse if you've never used it before.
Casting is fairly easy, but does require another interface or abstract
class.

However, neither approach may work with 10.4 Tiger.  The Tiger 1.4.2
RelNotes only mention the workaround in a local-app context, not a JWS or
remote context.  So it's not definitive from the RelNotes whether the
workaround works in JWS at all.  Or it might work different if the JNLP app
is stored locally.

Specific details of your main class might help.  Or a well-isolated test-case.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.