Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4898787
Votes 0
Synopsis Mnemonics for a JTabbedPane should use input map for WHEN_IN_FOCUSED_WINDOW
Category java:classes_swing
Reported Against 1.4.1
Release Fixed
State 11-Closed, duplicate of 4624207, bug
Priority: 4-Low
Related Bugs 4624207
Submit Date 30-JUL-2003
Description




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


FULL OS VERSION :
Windows NT Version 4.0

A DESCRIPTION OF THE PROBLEM :
Mnemonics for a JTabbedPane is currently defined in the input map for
WHEN_ANCESTOR_OF_FOCUSED_COMPONENT.  Is should be defined in the
input map for WHEN_IN_FOCUSED_WINDOW.

The reason for this is that if a mnemonic is rendered (i.e. underlined) the
user expectation is that Alt mnemonic key will activate the mnemonic regardless of where focus is in the window (whethen in the TabbedPane or not).

The fix for this is to change initMnemonics in BasicTabbedPaneUI to:

    private void initMnemonics() {
	mnemonicToIndexMap = new Hashtable();
	mnemonicInputMap = new ComponentInputMapUIResource(tabPane);

	InputMap parent = SwingUtilities.getUIInputMap(listTabbedPane,
			      JComponent.WHEN_IN_FOCUSED_WINDOW);
	mnemonicInputMap.setParent(parent);
	SwingUtilities.replaceUIInputMap(listTabbedPane,
			      JComponent.WHEN_IN_FOCUSED_WINDOW,
					 mnemonicInputMap);
    }


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Define a JTabbedPane with a mnemonic in a panel with another focusable component
(such as JButton) as a sibling to the JTabbedPane.  Then when running,
mnemonics do not work if the other focusable component has focus.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Alt-mnemonic to work even sibling components of the tab pane has focus
ACTUAL -
they dont

REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 192634) 
======================================================================
Work Around
N/A
Evaluation
This is a dup of 4624207
  xxxxx@xxxxx   2003-07-31
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang