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 @@ -103,6 +103,7 @@ public EditorFrame(Stage pMainStage, Stage pDialogStage) {
103103 aRecentFiles .deserialize (Preferences .userNodeForPackage (JetUML .class ).get ("recent" , "" ).trim ());
104104
105105 MenuBar menuBar = new MenuBar ();
106+ moveMenuBarToMacNativeMenuBar (menuBar );
106107 setTop (menuBar );
107108
108109 TabPane tabPane = new TabPane ();
@@ -146,6 +147,19 @@ private static String[] validFormats(String... pDesiredFormats) {
146147 }
147148 return validFormats .toArray (new String [validFormats .size ()]);
148149 }
150+
151+ /*
152+ * Moves the menu bar to the system menu bar on macOS systems.
153+ * A macOS system is indicated by the string "Mac OS X" in
154+ * System property `os.name`.
155+ */
156+ private void moveMenuBarToMacNativeMenuBar (MenuBar pMenuBar )
157+ {
158+ if (System .getProperty ("os.name" ).equals ("Mac OS X" ))
159+ {
160+ pMenuBar .setUseSystemMenuBar (true );
161+ }
162+ }
149163
150164 /*
151165 * Traverses all menu items up to the second level (top level
You can’t perform that action at this time.
0 commit comments