JDK-5087204 : Key operations stop working on AWT menu after certain operations
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2004-08-16
  • Updated: 2005-06-29
  • Resolved: 2005-06-29
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.
JDK 6
6 b38Fixed
Related Reports
Duplicate :  
Relates :  
Description
Name: dk106046			Date: 08/16/2004

OPERATING SYSTEM(S):
Linux (RH8.0, RHEL3/0, SLES8)

FULL JDK VERSION(S):
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)
Java HotSpot(TM) Client VM (build 1.4.2_05-b04, mixed mode)


1. Build testcase: javac Test.java

import java.awt.*;
import java.awt.event.*;

public class Test extends Frame implements ActionListener{
    Menu	m, sm;
    Label l1,l2;
    
    Test(){	
	super("Test");
	setLayout(new GridLayout(2,1));
	
	m = new Menu("menu",true);
	
	for(int i=0 ; i<3 ; i++){
	    MenuItem mi = new MenuItem("item "+i);
	    mi.addActionListener(this);
	    m.add(mi);
	}
	
	sm = new Menu("submenu");
	
	for(int i=0 ; i<3 ; i++){
	    MenuItem mi = new MenuItem("sub item "+i);
	    mi.addActionListener(this);
	    sm.add(mi);
	}
	
	m.add(sm);
	
	MenuBar mb = new MenuBar();
	mb.add(m);
	setMenuBar(mb);
	
	Panel p = new Panel();
	p.setLayout(new GridLayout(1,2));
	l1 = new Label("Selected Menu Item:");
	l2 = new Label("Nothing");
	p.add(l1);
	p.add(l2);
	add(p);
	
	Button Quit = new Button("Quit");
	Quit.addActionListener(this);
	add(Quit);
	
	setSize(500, 300);
	setVisible(true);
    }
    
    public void actionPerformed(ActionEvent e){
	String cmd = e.getActionCommand();
	
	if(cmd == "Quit"){
	    System.exit(0);
	}else{
	    l2.setText(cmd);
	}
    }
    public static void main(String[] args){
	Test t=new Test();
    }
}


2. Run testcase:     java Test

3. Click the menu to post its popup.

4. Click the "submenu" menu item so the sub menu is posted

5. Click the "submenu" menu item one more time so the submenu is hidden

6. After these operations,the Enter key or RightArrow key does not work for 
the "submenu" menu item (ie, cannot post it's popup using the keyboard). <-------- PROBLEM!!

======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
18-08-2004

EVALUATION Name: df153228 Date: 08/16/2004 The bug is very similar to the bug number 5087097. The behavior is reproducible on solaris-sparc on jdk1.4.2 and jdk1.5.0b60 ###@###.### ====================================================================== Name: df153228 Date: 08/17/2004 This is not a regression and this behavior is not critical for Tiger release. So we'll commit it on mustang. ###@###.### ======================================================================
18-08-2004

WORK AROUND Name: dk106046 Date: 08/16/2004 Use the mouse instead. ======================================================================
18-08-2004