JDK-6208545 : The popup menu displays the graphical box but there is no menu items inside the box.
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: solaris_8u7,venus_dev,5.0u2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: solaris_8,solaris_9,solaris_10
  • CPU: sparc
  • Submitted: 2004-12-14
  • Updated: 2011-05-12
  • Resolved: 2005-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0u3 b05Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Description
The popup menu displays the graphical box but there is no menu items
inside the box.

Here is a scenario that causes the same trouble we see on our GUI.   
Keep in mind that while this seems like an odd way to create the problem  
(no normal user would ever do this), it happens intermittently on our
product under normal use - this is just one way that was found to  
force the problem to happen "on demand".

Start SwingSet2 using
java - jar SwingSet2 (SwingSet2 is located in
/usr/java1.5/demo/jfc/SwingSet2.

>>> Click in any UI buttons for about 2 minutes.
>>> Click on the File menu and hold the arrow key -> for 5 minutes (you  
>>> can
>>> use scotch tape to hold key).
###@###.### 2004-12-14 22:00:49 GMT


Customer provided a new test case to reproduce the problem.
I am able to reproduce the problem as described below.

After launching the application, do the following:

(Note: there are several times when the app comes up *without*
 the menu labels, just a blank strip above the tabbed pane)

1. Select one fo the menus (Say Menu5) and press and hold the right
arrow key. This simply cycles thru all the menus.
2. After a while all the menus will blank out.
3. Now click on File menu and do Alt+S. You will see a blank
JOptionPane. 
4. Click on File menu and do Alt+ O. You will see a distorted
FileChooser dialog.



###@###.### 2005-2-04 00:21:51 GMT

Comments
EVALUATION Submitter indicates they get this behavior by: . Launch SwingSet . Tape down the right arrow key. . Click on the file menu. At this point the menus should continually open/close and at some point (> 5 minutes) in the future the menus stop painting. Submitter also indicated they're seeing this behavior on an SB2500 with Solaris 8. I've been unable to reproduce on Solaris 8 and 9 boxs and others have tried 10. I've contacted submitter to see if their machine has the correct set of patches for 1.5. As this doesn't appear to be specific to Solaris 10 I've also requested removing the show stopper keyword. As I haven't heard back from submitter in a day and this is marked as P1 I'm going to move to incomplete. Once I've resolved if the machine has the necessary patches I'll move out of incomplete. ###@###.### 2004-12-17 00:24:23 GMT I've tried on Solaris 9 and Win2K with both SwingSet2 and the attached testcase several times. Not able to reproduce the bug. ###@###.### 2005-2-11 22:01:54 GMT I suspect this is a duplicate of 6229387, reassigning to hotspot for verification. ###@###.### 2005-2-18 01:11:20 GMT This appears to be a duplicate of 5107525, which has already been fixed in Mustang. The backport to 5.0 should be easy. Would like the customer to attempt the -server alternate workaround, if possible. ###@###.### 2005-2-22 16:48:41 GMT
14-12-2004

SUGGESTED FIX See the PRT webrev at: http://analemma.sfbay.sun.com/net/prt-data.east/archives/1.5/tiger_update3_baseline/2005/20050302112142.rasbold.tiger_baseline/workspace/webrevs/webrev-2005.03.02/index.html ###@###.### 2005-03-02 20:17:12 GMT
14-12-2004

WORK AROUND In our testing we have uncovered a serious issue with JDK1.5. After we repeatedly access menus and other content within the GUI at some point the menus stop repainting and turn blank. We also noticed that error and other JOptions dialogs have the repaint problem. We are able to reproduce this problem on the SwingSet2 program from SUN. The behavior is strange i.e. we cannot see the menu items or the contents of the JOption dialog, however we can select items from the menu and dismiss the dialog using the keyboard. Our theory is that for some reason the sizes of the components get reset the Max size seems to be 32,000 X 32000. So based on the size theory we came up with the following workarounds: 1. menu workaround: After all the menu items were added to a menu: we would determine the size of the largest menu item, and iterate through all the items and set the Max, Min and Preferred size to be the preferred size of the largest menu item. 2. JOption solution: We wrote our own JOptionPane.createDialog changed the layout to be GridLayout; enemurated all the children of JOption pane and set the Max, Min sizes to the preferred size of the component. Call fixComponentSize just before we called dialog.pack() followed by dialog.setVisible( true ); public static JDialog createMyDialog(Component parentComponent, String title, JOptionPane optionPane) throws HeadlessException { final JDialog dialog; dialog = new JDialog((Dialog)parentComponent, title, true); dialog.setComponentOrientation(optionPane.getComponentOrientation()); Container contentPane = dialog.getContentPane(); contentPane.setLayout(new GridLayout(0, 1)); setSize(optionPane); contentPane.add(optionPane); dialog.setResizable(false); dialog.setLocationRelativeTo(parentComponent); return dialog; } private static void fixComponentSize(JComponent panel) { Component[] componentArray; componentArray = panel.getComponents(); for(int i = 0; i < componentArray.length; i++){ if(JPanel.class.isInstance(componentArray[i])){ setSize((JComponent)componentArray[i]); fixComponentSize((JComponent)componentArray[i]); }else{ setSize((JComponent)componentArray[i]); } } } private static void setSize(JComponent component){ Dimension dim = component.getPreferredSize(); component.setMaximumSize (dim); component.setMinimumSize (dim); } ###@###.### 2004-12-14 22:00:50 GMT Use -client ###@###.### 2005-2-18 01:11:20 GMT Try -XX:CompileCommand=exclude,javax/swing/SizeRequirements,expandedTile with -server. ###@###.### 2005-2-22 16:48:41 GMT
14-12-2004