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("", "true");
    System.setProperty("apple.awt.brushMetalLook", "true");
    System.setProperty("apple.laf.useScreenMenuBar", "true");

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

    Rationem, Mar 2, 2006
    1. Advertisements

  2. 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

    = Steve =
    Steve W. Jackson, Mar 2, 2006
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.