< prev index next >

src/java.desktop/share/classes/java/awt/MenuComponent.java

Print this page

        

@@ -295,17 +295,19 @@
      * @see       #getFont
      * @see       Font#getAttributes
      * @see       java.awt.font.TextAttribute
      */
     public void setFont(Font f) {
+        synchronized (getTreeLock()) {
         font = f;
         //Fixed 6312943: NullPointerException in method MenuComponent.setFont(Font)
         MenuComponentPeer peer = this.peer;
         if (peer != null) {
             peer.setFont(f);
         }
     }
+    }
 
     /**
      * Removes the menu component's peer.  The peer allows us to modify the
      * appearance of the menu component without changing the functionality of
      * the menu component.
< prev index next >