JDK-5101986 : JMenu renders falsely (unused blank space at the bottom) on first time popup
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-09-14
  • Updated: 2004-09-23
  • Resolved: 2004-09-23
Related Reports
Duplicate :  
Description

Name: gm110360			Date: 09/14/2004


FULL PRODUCT VERSION :
java version "1.5.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-rc-b63)
Java HotSpot(TM) Client VM (build 1.5.0-rc-b63, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Windows XP with SP1

A DESCRIPTION OF THE PROBLEM :
When a JMenu added to a JFrame pops up for the first time, there is a unused blank space added under/at the bottom of  the last  JMenuItem. When you close the JMenu and reopen it again, the blank space under  the last JMenuItem is gone.

For multiple recursive added submenus the blank space added at the bottom of the last JMenuItem increases wich each submenu level.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Simply use the JMenu Webstart demo from your java tutorial:
http://java.sun.com/docs/books/tutorialJWS/uiswing/components/example-1dot4/MenuDemo.jnlp

REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 302327) 
======================================================================

Comments
EVALUATION The bug is caused by the same reason as bug 5089312. At the time when pack() is being called on the popup for the first time, top inset of the window that contains popup is -1 which confuses layout manager and makes it paint sub-components one pixel shorter than needed. So, every single menu item adds one pixel of unused space to the end of the menu. Closing this bug as duplicate of 5089312.
26-09-2004