-
Bug
-
Resolution: Fixed
-
P3
-
6, 6u1, 7
-
b86
-
b10
-
generic, x86
-
generic, windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2146540 | 6u2 | Mikhail Lapshin | P3 | Resolved | Fixed | b02 |
JDK-2193757 | 5.0u25 | Mala Bankal | P3 | Closed | Fixed | b03 |
1. Install some input method, e.g., CodePointIM demo into 'lib/ext' directory.
2. Run some Swing WebStart application that have a text field, e.g., Bugster.
3. Move focus to the text field.
4. Bring up the 'input method selection' pop up menu. On Windows, click on the system icon on the top-left corner of the frame and then select "Select Input Method" menu item.
5. Popup menu is actually displayed, but you cannot operate with it.
This seems to happen on Java 6 only. I could not reproduce it with 1.5.0_06.
I found one more regression of 6280964:
Look at the lines in BasicPopupMenuUI.installListeners() :
if (!menuKeyboardHelperInstalled) {
if (menuKeyboardHelper == null) {
menuKeyboardHelper = new MenuKeyboardHelper();
}
MenuSelectionManager msm = MenuSelectionManager.defaultManager();
msm.addChangeListener(menuKeyboardHelper);
menuKeyboardHelperInstalled = true;
}
Here menuKeyboardHelper is a static variable. Now only one instance of MenuKeyboardHelper is shared between all MenuSelectionManagers (and all EDTs). menuKeyboardHelper static field should be replaced by a variable in AppContext (as MouseGrabber at couple of lines above).
Copied from the description of 6484971:
JMenu works unstable when two applets work in different AppContexts,
sometimes they don't respond to key events like stop to move the menu selection
by arrow buttons and stop to react on menuItem's accelerators
How to reproduce:
run the provided applet in one JVM but in differect AppContext's
e.g. in Mozilla you should copy class files to two differect directories
and launch them in two browser's instances
To make sure check the console,
you need to have the same "Singleton" value
and the different AppContext.getAppContext().hashCode() value
Play with the menus of both applets several times,
you will the the described problems
JDK 1.5 and 1.6
import sun.awt.AppContext;
import javax.swing.*;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class MenuTest extends JApplet {
public void init() {
System.out.println("Singleton = " + ToolTipManager.sharedInstance().hashCode());
System.out.println("AppContext.getAppContext().hashCode() = " + AppContext.getAppContext().hashCode());
JMenu menu = new JMenu("Menu");
menu.setMnemonic('m');
menu.add(new JMenuItem("item"));
JMenuItem item = new JMenuItem("item");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
item.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
JOptionPane.showConfirmDialog(MenuTest.this, "Is everything ok ?");
}
});
menu.add(item);
menu.add(new JMenuItem("item"));
JMenuBar bar = new JMenuBar();
bar.add(menu);
setJMenuBar(bar);
}
}
- backported by
-
JDK-2146540 Cannot select a Java input method in an WebStarted application
- Resolved
-
JDK-2193757 Cannot select a Java input method in an WebStarted application
- Closed
- duplicates
-
JDK-6512167 JMenu can't be closed after pressing Escape key
- Closed
-
JDK-6543222 REGRESSION: BasicPopupMenuUI.MenuKeyboardHelper needs to be per-AppContext
- Closed
-
JDK-2148300 REGRESSION: BasicPopupMenuUI.MenuKeyboardHelper needs to be per-AppContext
- Closed
- relates to
-
JDK-6544309 PIT:Unable to select the item's in 'input method selection' popupmenu by using keyboard.
- Closed
-
JDK-6570749 sun.awt.im.InputMethodPopupMenu should be the same in 6u3 and 7
- Resolved
-
JDK-6540786 BasicPopupMenuUI: MenuKeyboardHelper.uninstall() and MouseGrabber.uninstall() should be synchronized
- Closed