File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,7 @@ public EditorFrame(Stage pMainStage, Stage pDialogStage)
105105 aRecentFiles .deserialize (Preferences .userNodeForPackage (JetUML .class ).get ("recent" , "" ).trim ());
106106
107107 MenuBar menuBar = new MenuBar ();
108+ moveMenuBarToMacNativeMenuBar (menuBar );
108109 setTop (menuBar );
109110
110111 TabPane tabPane = new TabPane ();
@@ -155,6 +156,19 @@ private static String[] validFormats(String... pDesiredFormats)
155156 }
156157 return validFormats .toArray (new String [validFormats .size ()]);
157158 }
159+
160+ /*
161+ * Moves the menu bar to the system menu bar on macOS systems.
162+ * A macOS system is indicated by the string "Mac OS X" in
163+ * System property `os.name`.
164+ */
165+ private void moveMenuBarToMacNativeMenuBar (MenuBar pMenuBar )
166+ {
167+ if (System .getProperty ("os.name" ).equals ("Mac OS X" ))
168+ {
169+ pMenuBar .setUseSystemMenuBar (true );
170+ }
171+ }
158172
159173 /*
160174 * Traverses all menu items up to the second level (top level
You can’t perform that action at this time.
0 commit comments