In article <. com>,
"Rationem" <> wrote:
> I am trying to move the menu bar for my java app to the top of the
> screen while it is running on a mac.
>
> I have the following code but it has no effect:
>
> System.setProperty("com.apple.macos.useScreenMenuB ar", "true");
> System.setProperty("apple.awt.brushMetalLook", "true");
> System.setProperty("apple.laf.useScreenMenuBar", "true");
> System.setProperty("com.apple.mrj.application.appl e.menu.about.name",
> "Viewer");
>
> The menu bar is still atached to the JFrame - any ideas?
>
> Thanks,
> Adam
The last time I checked Apple's site, most of those properties could
indeed be set either via the command line (using -D) or by using the
System.setProperty call. I haven't tried the latter. But in order for
it to matter, it will have to be done very early in your code -- meaning
before you begin constructing your Swing components -- or you'll need to
force an update of the UI.
You'll also need to make sure you've got the correct property names.
According to Apple's site, apple.laf.useScreenMenuBar is the correct
property to use the top menu instead of one inside your JFrame.
As a simple test, you could try those properties on the command line
first. When launching your application, make sure that the command line
includes -Dapple.laf.useScreenMenuBar=true for the first one, for
example. And get the most up to date Java documentation at
<http://developer.apple.com/documentation/Java/index-date.html>.
= Steve =
--
Steve W. Jackson
Montgomery, Alabama
|