OSDN Git Service

Merged gcj-eclipse branch to trunk.
[pf3gnuchains/gcc-fork.git] / libjava / classpath / javax / swing / plaf / metal / MetalMenuBarUI.java
index ff763ea..4066194 100644 (file)
@@ -1,5 +1,5 @@
 /* MetalMenuBarUI.java -- MenuBar UI for the Metal L&F
-   Copyright (C) 2005 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -76,12 +76,15 @@ public class MetalMenuBarUI extends BasicMenuBarUI
    */
   public void update(Graphics g, JComponent c)
   {
+    int height = c.getHeight();
     if (c.isOpaque()
         && UIManager.get("MenuBar.gradient") != null
-        && c.getBackground() instanceof UIResource)
+        && c.getBackground() instanceof UIResource
+        && height > 2)
       {
-        MetalUtils.paintGradient(g, 0, 0, c.getWidth(), c.getHeight(),
+        MetalUtils.paintGradient(g, 0, 0, c.getWidth(), height - 2,
                                  SwingConstants.VERTICAL, "MenuBar.gradient");
+        
         paint(g, c);
       }
     else