-
Bug
-
Resolution: Fixed
-
P4
-
6u13
-
b60
-
x86
-
solaris_2.5.1
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2184373 | OpenJDK6 | Peter Zhelezniakov | P3 | Resolved | Fixed | b18 |
FULL PRODUCT VERSION :
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
(same error in 1.6.0_14)
ADDITIONAL OS VERSION INFORMATION :
Linux kurt-ubuntu 2.6.27-14-generic #1 SMP Fri Mar 13 18:00:20 UTC 2009 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
ImageMap for RootPane.ancestorInputMap is not set in Nimbus - so the Contextkey is not working.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try the testprogram
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Dialog.ModalityType;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
import ui.UIUtils;
import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
public class ContextMenuKeyNotWorkingInNimbus {
public static void main(final String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// UIManager.setLookAndFeel(MetalLookAndFeel.class.getName());
// UIManager.setLookAndFeel(GTKLookAndFeel.class.getName());
UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
} catch (final Exception e) {
e.printStackTrace();
}
}
});
SwingUtilities.invokeLater(new Runnable() {
public void run() {
UIUtils.checkUI();
final JPopupMenu pum = new JPopupMenu("pum");
pum.add("first item");
final String title = "ContextMenu-error";
final JDialog d = new JDialog(null, title, ModalityType.DOCUMENT_MODAL);
d.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
final JComponent jc =
new JTextArea("current L&F: " + UIManager.getLookAndFeel().getName()
+ "\nContext-Menu-Key produces no context menu in Nimbus-L&F"
+ "\nworks fine with Metal-L&F");
jc.setComponentPopupMenu(pum);
d.getContentPane().add(jc);
d.pack();
d.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Server VM (build 11.3-b02, mixed mode)
(same error in 1.6.0_14)
ADDITIONAL OS VERSION INFORMATION :
Linux kurt-ubuntu 2.6.27-14-generic #1 SMP Fri Mar 13 18:00:20 UTC 2009 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
ImageMap for RootPane.ancestorInputMap is not set in Nimbus - so the Contextkey is not working.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
try the testprogram
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.Dialog.ModalityType;
import javax.swing.JComponent;
import javax.swing.JDialog;
import javax.swing.JPopupMenu;
import javax.swing.JTextArea;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.WindowConstants;
import ui.UIUtils;
import com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel;
public class ContextMenuKeyNotWorkingInNimbus {
public static void main(final String[] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
try {
// UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
// UIManager.setLookAndFeel(MetalLookAndFeel.class.getName());
// UIManager.setLookAndFeel(GTKLookAndFeel.class.getName());
UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName());
} catch (final Exception e) {
e.printStackTrace();
}
}
});
SwingUtilities.invokeLater(new Runnable() {
public void run() {
UIUtils.checkUI();
final JPopupMenu pum = new JPopupMenu("pum");
pum.add("first item");
final String title = "ContextMenu-error";
final JDialog d = new JDialog(null, title, ModalityType.DOCUMENT_MODAL);
d.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
final JComponent jc =
new JTextArea("current L&F: " + UIManager.getLookAndFeel().getName()
+ "\nContext-Menu-Key produces no context menu in Nimbus-L&F"
+ "\nworks fine with Metal-L&F");
jc.setComponentPopupMenu(pum);
d.getContentPane().add(jc);
d.pack();
d.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2184373 Contextkey does not work in Nimbus
- Resolved