Hi,
I'm using JDK 15.0.1. The JRE System Library rt.jar has classes throwing a NoSuchFieldException when getting KeyStroke for a list of keys in com.apple.laf.AquaKeyBindings.
I've been trying to find a solution to prevent the exception from within my code witrhout success. Has anyone encountered this problem? All suggestions are welcome!
Thank you,
Don6421
The debug trace stack looks like the following (top of stack is the current execution):
Class<KeyEvent>.getField("VK_RETURN") -- See Note 1
AWTKeyStroke.getVKValue("VK_RETURN")
AWTKeyStroke.getAWTKeyStroke("RETURN")
KeyStroke.getKeyStroke("RETURN")
LookAndFeel.loadKeyBindings(InputMap retMap, Object[] keys) -- See Note 2
LookAndFeel.makeInputMap(Object[] keys) -- See Note 2
AquaKeyBindings$LateBoundInputMap.createValue(UIDe faults)
UIDefaults.getFromHashtable("Tree.inputFocusMap")
UIDefaults.get("Tree.inputFocusMap", Locale)
MultiUIDefaults.get("Tree.inputFocusMap", Locale)
UIManager.get("Tree.inputFocusMap", Locale)
DefaultLookuyp(TreeTableTree, AquaTreeUI, "Tree.inputFocusMap") -- See Note 3
AquaTreeUI(BasicTreeUI).getInputMap(int condition)
AquaTreeUI(BasicTreeUI).installKeyboardActions()
AquaTreeUI.installKeyboardActions()
AquaTreeUI(BasicTreeUI).installUI(TreeTableTree)
TreeTableTree(JComponent).setUI(AquaTreeUI)
TreeTableTree(JTree).setUI(AquaTreeUI)
TreeTableTree(JTree).updateUI()
TreeTableTree.updateUI()
TreeTableTree(JTree) <init>(TreeModel)
TreeTableTree(TreeExtended). <init>(TreeModelExtended)
TreeTable <init>()
TreeTableModel <init>()
TreeTable <init>(TableColumnExtended[], ITableCellRenderer[])
DefaultView.createWorkArea()
DefaultView.createWorkToolsArea()
DefaultView.createWorkToolsSupportArea()
DefaultView <init>(EmptyBorder)
DefaultView <init>()
Application.setContentPane()
Application(AbstractFrame<OWNER>) <init>(Dimension)
Application(AbstractFrame<OWNER>) <init>(String, Dimension)
Application(DefaultFrame<OWNER>) <init>(String)
Application <init>()
Application.main(String[])
Note 1: Class.getField(String) tries to get the static field VK_RETURN, but it doesn't exist. VK_ENTER does exist. NoSuchFieldException thrown.
Note 2: The action list (Object[] keys) is String [
VK KEY, ACTION
"meta C", "copy",
"meta V", "paste",
"meta X", "cut",
"COPY", "copy,
"PASTE", "paste",
"CUT", "cut",
"UP", "selectPrevious",
"KP_UP", "selectPrevious",
"shift UP", "selectPreviousExtendSelection",
"shift KP_UP", "selectPreviousExtendSelection",
"DOWN", "selectNext",
"KP_DOWN",
"shift DOWN", "selectNextExtendSelection",
"shift KP_DOWN", "selectNextExtendSelection",
"RIGHT", "aquaExpandNode",
"KP_RIGHT", "aquaExpandNode",
"LEFT", "aquaCollapseNode",
"KP_LEFT", "aquaCollapseNode",
"shift RIGHT", "aquaExpandNode",
"shift KP_RIGHT", "aquaExpandNode",
"shift LEFT", "aquaCollapseNode",
"shift KP_LEFT", "aquaCollapseNode",
"ctrl Left", "aquaCollapseNode",
"ctrl KP_LEFT", "aquaCollapseNode",
"ctrl RIGHT", "aquaExpandNode",
"ctrl KP_RIGHT", "aquaExpandNode",
"alt RIGHT", "aquaFullyExpandNode",
"alt KP_RIGHT". "aquaFullyExpandNode",
"alt LEFT", "aquaFullyCollapseNode",
"alt KP_LEFT", "aquaFullyCollapseNode",
"meta A", "selectAll",
"RETURN", "startEditing"
]
Note 3: sun.swing.DefaultLookup