JDK-4864718 : After minimizing all JInternalFrames the Menu can't be activated by F10
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-05-15
  • Updated: 2005-05-23
  • Resolved: 2005-05-23
Related Reports
Relates :  
Relates :  
Description

Name: rmT116609			Date: 05/15/2003


FULL PRODUCT VERSION :
java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

FULL OS VERSION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
After minimizing all the JInternalFrames on a JDesktopPane and the component focused on the last minimized JInternalFrame was a JTextFiled or JTextArea, i was unable to activate the JMenuBar (or MenuBar) by pressing the F10 button.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Start application with MenuBar, JDesktopPane and JInternalFrames
2. Minimize all JInternalFrams but one.
3. Make sure the one remaining JInternalFrame contain a JTextField or JTextArea and the JTextField or JTextArea has focus.
4. Minimize the last JInternalFrame.
5. Press F10 to activate the menu - IT WON'T WORK.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Pressing F10 should activate the menu.
ACTUAL -
Pressing F10 will not activate the menu.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLayeredPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;

public class TestFrame extends JFrame {
	MenuBar bar = new MenuBar();
	Menu menu = new Menu("Test menu");
	Menu menu2 = new Menu("Test menu2");

	MenuItem menuItem = new MenuItem("Test menu item");
	MenuItem menuItem2 = new MenuItem("Test menu item2");
	
	JDesktopPane desktop = new JDesktopPane();

	public TestFrame() {

		setTitle("Testing");
		setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		
		setSize(600, 600);

		menu.add(menuItem);
		menu2.add(menuItem2);
		bar.add(menu);
		bar.add(menu2);
		setMenuBar(bar);

		JPanel pe = new JPanel();
		pe.add(new JTextField("Testing"));
		pe.add(new JButton("Blah"));
				
		getContentPane().add(desktop);
		
		JInternalFrame iFrame1 = new JInternalFrame("TestInternalFrame", true, true, true, true);
		
		iFrame1.setSize(200, 100);
		iFrame1.getContentPane().add(pe);
		
		desktop.add(iFrame1, JLayeredPane.DEFAULT_LAYER);
		
		try {
			iFrame1.show();
		} catch (Exception e) {
			e.printStackTrace();
		}

		show();
	}

	public static void main(String[] args) {
		new TestFrame();
	}
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Non found yet. (Activating the menu by mouseclick works but that's not an option for me)
(Review ID: 185846) 
======================================================================

Comments
EVALUATION Unable to reproduce this under Linux. I'm gonna give it a try under Windows 2000. ###@###.### 2003-05-19 Able to reproduce under windows. Converted program to pure swing and problem still occurs. Need to find out what the problem is under Windows. The problem is most likely due to the desktop icons not being focusable. So if they are not focusable keyboard bindings won't get invoked. We need to make the desktop icons focusable. ###@###.### 2004-09-03 Not reproducible on 1.6.0-ea-b37. ###@###.### 2005-05-23 22:44:24 GMT
03-09-2004