Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Mac Menu Bar Issue

Reply
Thread Tools

Mac Menu Bar Issue

 
 
Rationem
Guest
Posts: n/a
 
      03-02-2006
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

 
Reply With Quote
 
 
 
 
Steve W. Jackson
Guest
Posts: n/a
 
      03-02-2006
In article <(E-Mail Removed). com>,
"Rationem" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to hide toolbar, menu bar, address bar, other non-essentials. Tim Javascript 1 01-18-2005 08:18 PM
disable title bar, status bar, and address bar of a window Matt HTML 9 08-23-2004 07:49 PM
javascript to disable the title bar, status bar, and address bar of a window Matt Javascript 9 08-23-2004 01:23 PM
Re: disable title bar, status bar, and address bar of a browser window John Hann ASP .Net 0 08-21-2004 05:07 AM
disable title bar, status bar, and address bar of a browser window Matt ASP .Net 0 08-21-2004 03:50 AM



Advertisments