JTable table = new JTable(); InputMap inputMap = table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); // Get the action map for the JTable ActionMap actionMap = table.getActionMap();This example retrieves the input map for the JTable that is active. The `JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT` constant specifies that the input map is for an ancestor component that has the focus. The example also retrieves the action map for the JTable. Package library: javax.swing.