Here you can find the source of removeTabbedPaneFocusTraversalKeyBindings( JComponent c)
Parameter | Description |
---|---|
c | The component to modify. |
public static void removeTabbedPaneFocusTraversalKeyBindings( JComponent c)
//package com.java2s; /*/* ww w . ja v a 2 s .com*/ * 03/01/2004 * * RTextUtilities.java - Standard tools used by several pieces of RText. * Copyright (C) 2004 Robert Futrell * http://fifesoft.com/rtext * Licensed under a modified BSD license. * See the included license file for details. */ import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import javax.swing.InputMap; import javax.swing.JComponent; import javax.swing.KeyStroke; public class Main { /** * Remove problematic actions that prevent Ctrl+PageUp/PageDown from * being used for cycling through active documents. * * @param c The component to modify. */ public static void removeTabbedPaneFocusTraversalKeyBindings( JComponent c) { InputMap im = c .getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.CTRL_MASK), "nothing"); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.CTRL_MASK), "nothing"); im = c.getInputMap(); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, InputEvent.CTRL_MASK), "nothing"); im.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, InputEvent.CTRL_MASK), "nothing"); } }