Mac Menu Bar Issue

Discussion in 'Java' started by Rationem, Mar 2, 2006.

  1. Rationem

    Rationem Guest

    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.useScreenMenuBar", "true");
    System.setProperty("apple.awt.brushMetalLook", "true");
    System.setProperty("apple.laf.useScreenMenuBar", "true");
    System.setProperty("com.apple.mrj.application.apple.menu.about.name",
    "Viewer");

    The menu bar is still atached to the JFrame - any ideas?

    Thanks,
    Adam
    Rationem, Mar 2, 2006
    #1
    1. Advertising

  2. In article <>,
    "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.useScreenMenuBar", "true");
    > System.setProperty("apple.awt.brushMetalLook", "true");
    > System.setProperty("apple.laf.useScreenMenuBar", "true");
    > System.setProperty("com.apple.mrj.application.apple.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
    Steve W. Jackson, Mar 2, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    0
    Views:
    3,541
  2. John Hann
    Replies:
    0
    Views:
    6,073
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    70,833
  4. Matt
    Replies:
    9
    Views:
    541
    kaeli
    Aug 23, 2004
  5. Tim
    Replies:
    1
    Views:
    291
    Grant Wagner
    Jan 18, 2005
Loading...

Share This Page