JAL-4398 Instantiate (static) JMenu windowMenu at the same time as the other (instanc...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 29 Apr 2024 07:43:55 +0000 (08:43 +0100)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 29 Apr 2024 07:43:55 +0000 (08:43 +0100)
src/jalview/jbgui/GDesktop.java

index 3d606e3..90b8024 100755 (executable)
@@ -48,7 +48,7 @@ import jalview.util.Platform;
 public class GDesktop extends JFrame
 {
 
-  protected static JMenu windowMenu = new JMenu();
+  protected static JMenu windowMenu = null;
 
   JMenuBar desktopMenubar = new JMenuBar();
 
@@ -110,6 +110,13 @@ public class GDesktop extends JFrame
   public GDesktop()
   {
     super();
+
+    // instantiate here to set same context (e.g. font) as other menus
+    if (windowMenu == null)
+    {
+      windowMenu = new JMenu();
+    }
+
     try
     {
       jbInit();