Please note:. Although I mention Swing and MacOS here, this question has nothing to do with any of them: I just provide them as a concrete example of what I'm trying to do.
I am trying to set the groovy system property. If you are developing a Swing application on a Mac, it is common practice to set the following system property to make your Swing application menu look like regular Mac applications:
System.setProperty("apple.laf.useScreenMenuBar", "true")
When I call this inside my main
method, it has the desired effect (the menu bar is removed from the JFrame
and docked at the top of the screen).
But when I go try to make this groovier call:
System.properties['apple.laf.useScreenMenuBar', 'true']
he does not work. No exceptions, it just stops working and does not have the desired effect in the user interface. Why and what can I do to fix this?
source share