Skip to main content


developerWorks  >   Java™ technology  >   IBM Developer kits  >   Additional documentation  >   IBM - Swing Key Bindings in Java  >  

Additional documentation

developerWorks


IBM - Swing Key Bindings in Java

IBM - Swing Key Bindings in Java

This document describes the default key bindings used in the three most common Java look and feels.



Standard components
Structured components
Menu, Toolbar, and ToolTip components
Text components
Containers: Frames, Windows, Panes, and Icons


Standard components
Metal look and feel keys Windows look and feel keys Motif look and feel keys
JButton
Navigate Forward Tab Tab Tab
Navigate backward Shift+Tab Shift+Tab Shift+Tab
Activate default Enter Enter Enter
Activate any Spacebar Spacebar Spacebar
Activate any Alt+Char accel. key, if defined Alt+Char accel. key, if defined Alt+Char accel. key, if defined
JCheckBox
Navigate forward Tab Tab Tab
Navigate backward Shift+Tab Shift+Tab Shift+Tab
Navigate within group Arrow keys Arrow keys Arrow keys
Check and Uncheck Spacebar Spacebar Spacebar
JRadioButton
Navigate forward Tab Tab Tab
Navigate backward Shift+Tab Shift+Tab Shift+Tab
Navigate within group Arrow keys Arrow keys Arrow keys
Note: Navigating with the Tab keys does not select the button you navigate to, but navigating with Arrow keys does select the button.
Check and Uncheck Spacebar Spacebar Spacebar
JToggleButton
Navigate forward Tab Tab Tab
Navigate backward Shift+Tab Shift+Tab Shift+Tab
Navigate within group Arrow keys Arrow keys Arrow keys
Check and Uncheck Spacebar Spacebar Spacebar
JComboBox
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Post menu Alt+Down Alt+Down Alt+Down
Retract menu Esc Esc Esc
Retract menu Alt+Up Alt+Up Alt+Up
Toggle menu up or down Alt+Up/Down Alt+Up/Down Alt+Up/Down
Activate menu item Enter Enter Enter
Jump to menu item without selecting it Initial char of item Initial char of item Initial char of item
Move up or down Up, Down Up, Down Up, Down
Note A: For other navigation keys, see JList.
Note B: For more information on EditField, see JTextField.
JList
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Move within list Up, Down Up, Down Up, Down
Move to beginning of list Ctrl+Home Ctrl+Home Ctrl+Home
Move to end of list Ctrl+End Ctrl+End Ctrl+End
Select all entries Ctrl+A Ctrl+A Ctrl+A
Make a selection Spacebar Spacebar Spacebar
Note: This will deselect previous selection
Extend selection up Shift+Up Shift+Up Shift+Up
Extend selection down Shift+Down Shift+Down Shift+Down
Extend selection to top Shift+Home Shift+Home Shift+Home
Extend selection to end Shift+End Shift+End Shift+End
Block extend up Shift+PgUp Shift+PgUp Shift+PgUp
Block extend down Shift+PgDn Shift+PgDn Shift+PgDn
Block move PgUp, PgDn PgUp, PgDn PgUp, PgDn
JSlider
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Increase value Up, Right Up, Right Up, Right
Decrease value Left, Down Left, Down Left, Down
Minimum value Home Home Home
Maximum value End End End
Block increase PgUp PgUp PgUp
Block decrease PgDn PgDn PgDn

Structured components
Metal look and feel keys Windows look and feel keys Motif look and feel keys
JTable
Navigate out forward Ctrl+Tab Ctrl+Tab Ctrl+Tab
Navigate out backward Ctrl+Shift+Tab Ctrl+Shift+Tab Ctrl+Shift+Tab
Move to next cell Tab Tab Tab
Move to next cell Right Arrow Right Arrow Right Arrow
Move to previous cell Shift+Tab Shift+Tab Shift+Tab
Move to previous cell Left Arrow Left Arrow Left Arrow
Wrap to next row Tab Tab Tab
Wrap to previous row Shift+Tab Shift+Tab Shift+Tab
Block move vertical PgUp, PgDn PgUp, PgDn PgUp, PgDn
Block move left Ctrl+PgUp Ctrl+PgUp Ctrl+PgUp
Block move right Ctrl+PgDn Ctrl+PgDn Ctrl+PgDn
Block extend vertical Shift+PgUp/PgDn Shift+PgUp/PgDn Shift+PgUp/PgDn
Block extend left Ctrl+Shift+PgUp Ctrl+Shift+PgUp Ctrl+Shift+PgUp
Block extend right Ctrl+Shift+PgDn Ctrl+Shift+PgDn Ctrl+Shift+PgDn
Move to first cell in row Home Home Home
Move to last cell in row End End End
Move to first cell in table Ctrl+Home Ctrl+Home Ctrl+Home
Move to last cell in table Ctrl+End Ctrl+End Ctrl+End
Select all cells Ctrl+A Ctrl+A Ctrl+A
Deselect current selection Up/Down Arrow Up/Down Arrow Up/Down Arrow
Deselect current selection Ctrl+Up/Down Arrow Ctrl+Up/Down Arrow
Deselect current selection Pgup/Pgdn Pgup/Pgdn Pgup/Pgdn
Deselect current selection Ctrl+Pgup/Pgdn Ctrl+Pgup/Pgdn Ctrl+Pgup/Pgdn
Deselect current selection Home/End Home/End Home/End
Deselect current selection Ctrl+Home/End Ctrl+Home/End Ctrl+Home/End
Extend selection one row Shift+Up/Down Shift+Up/Down Shift+Up/Down
Extend selection one column Shift+Left/Right Shift+Left/Right Shift+Left/Right
Extend selection to beginning or end of row Shift+Home/End Shift+Home/End Shift+Home/End
Extend selection to beginning or end of column Ctrl+Shift+Home/End Ctrl+Shift+Home/End Ctrl+Shift+Home/End
Edit cell without overriding current contents F2 F2 F2
Reset cell content prior to editing Esc Esc Esc
JTree
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Expand entry Right Right Right
Collapse entry Left Left Left
Toggle expand and collapse for entry Enter Enter Enter
Move up or down one entry Up, Down Up, Down Up, Down
Move to first entry Home Home Home
Move to last visible entry End End End
Block move vertical PgUp, PgDn PgUp, PgDn PgUp, PgDn
Block extend vertical Shift+PgUp, Shift+PgDn Shift+PgUp, Shift+PgDn Shift+PgUp, Shift+PgDn
Select all Ctrl+A Ctrl+A Ctrl+A
Select all Ctrl+Slash Ctrl+Slash Ctrl+Slash
Deselect all Ctrl+\ Ctrl+\ Ctrl+\
Single select Ctrl+Spacebar Ctrl+Spacebar Ctrl+Spacebar
Extend selection up Shift+Up Shift+Up Shift+Up
Extend selection down Shift+Down Shift+Down Shift+Down
Extend selection to start of data Shift+Home Shift+Home Shift+Home
Extend selection to end of data Shift+End Shift+End Shift+End

Menu, Toolbar, and ToolTip components
Metal look and feel keys Windows look and feel keys Motif look and feel keys
JMenuBar
Jump to menubar Alt Alt Alt
Navigate out Esc Esc Esc
Navigate out Alt Alt Alt
Navigate between items within menu Arrow keys Arrow keys Arrow keys
Select first item (if no item selected) F10 F10 F10
Select next item Right Right Right
Select previous item Left Left Left
Post menu Up, Down Up, Down Up, Down
Post menu Enter Enter Enter
Post menu Spacebar Spacebar Spacebar
Un-post menu Esc Esc Esc
Un-post menu Alt Alt Alt
JMenu
Post menu F10 F10 F10
Post submenu Right Right Right
Move to next item (wrap to top) Down Down Down
Move to previous item (wrap to bottom) Up Up Up
Retract menu Esc Esc Esc
Retract submenu Left Left Left
Activate default or selected item Enter Enter Enter
JMenuItem
Navigate in Arrow keys Arrow keys Arrow keys
Navigate out Arrow keys Arrow keys Arrow keys
Activate item Enter Enter Enter
Activate item Spacebar Spacebar Spacebar
Activate item Alt+Char accel. key, if defined Alt+Char accel. key, if defined Alt+Char accel. key, if defined
Post submenu Right Right Right
Retract submenu Left Left Left
Retract submenu Esc Esc Esc
JCheckBoxMenuItem
Navigate in Arrow keys Arrow keys Arrow keys
Navigate out Arrow keys Arrow keys Arrow keys
Check or Uncheck item and retract menu Enter Enter Enter
JRadioButtonMenuItem
Navigate in Arrow keys Arrow keys Arrow keys
Navigate out Arrow keys Arrow keys Arrow keys
Check or Uncheck item and retract menu Enter Enter Enter
JPopupMenu
Post submenu Right Right Right
Close submenu Left Left Left
Retract menu Esc Esc Esc
Move within menu Up, Down Up, Down Up, Down
Activate entry Enter Enter Enter
Activate entry Spacebar Spacebar Spacebar
JToolBar
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Navigate within Arrow keys Arrow keys Arrow keys
Activate item Spacebar Spacebar Spacebar
JToolTip
Post tip Ctrl+F1 Ctrl+F1 Ctrl+F1
Retract tip Esc Esc Esc
Retract tip Ctrl+F1 Ctrl+F1 Ctrl+F1

Text components
Metal look and feel keys Windows look and feel keys Motif look and feel keys
JTextField
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Move to previous or next char Left, Right Left, Right Left, Right
Move to previous or next word Ctrl+Left, Ctrl+Right Ctrl+Left, Ctrl+Right Ctrl+Left, Ctrl+Right
Move to start or end of field Home/End Home/End Home/End
Select all Ctrl+A Ctrl+A
Deselect all Arrow keys Arrow keys Arrow keys
Extend selection left or right Shift+Left, Shift+Right Shift+Left, Shift+Right Shift+Left, Shift+Right
Extend selection to start or end Shift+Home, Shift+End Shift+Home, Shift+End Shift+Home, Shift+End
Extend selection to previous or next word Ctrl+Shift+Left, Ctrl+Shift+Right Ctrl+Shift+Left, Ctrl+Shift+Right Ctrl+Shift+Left, Ctrl+Shift+Right
Copy selection Ctrl+C Ctrl+C
Cut selection Ctrl+X Ctrl+X
Paste from clipboard Ctrl+V Ctrl+V
Delete next character Delete Delete Delete
Delete previous character Backspace Backspace Backspace
Note: The Ctrl+A, Ctrl+C, Ctrl+X and Ctrl+V combinations only work on JFormattedTextFields
JPasswordField
Note: for information on how to navigate or move within the field, and make selections, see JTextField.
JTextArea
Navigate in Tab Tab Tab
Navigate out forward Ctrl+Tab Ctrl+Tab Ctrl+Tab
Navigate out backward Ctrl+Shift+Tab Ctrl+Shift+Tab Ctrl+Shift+Tab
Move up or down one line Up, Down Up, Down Up, Down
Move left or right one char Left, Right Left, Right Left, Right
Move to start or end of line Home, End Home, End Home, End
Move to previous or next word Ctrl+Left/Right Ctrl+Left/Right Ctrl+Left/Right
Move to start or end of text area Ctrl+Home/End Ctrl+Home/End Ctrl+Home/End
Block move up or down PgUp, PgDn PgUp, PgDn PgUp, PgDn
Block move left Ctrl+PgUp Ctrl+PgUp
Block move right Ctrl+PgDn Ctrl+PgDn
Block extend up Shift+PgUp Shift+PgUp Shift+PgUp
Block extend down Shift+PgDn Shift+PgDn Shift+PgDn
Block extend left Ctrl+Shift+PgUp Ctrl+Shift+PgUp Ctrl+Shift+PgUp
Block extend right Ctrl+Shift+PgDn Ctrl+Shift+PgDn Ctrl+Shift+PgDn
Select all Ctrl+A Ctrl+A
Deselect all Arrow keys Arrow keys Arrow keys
Extend selection Shift+Up, Shift+Down Shift+Up, Shift+Down Shift+Up, Shift+Down
Extend selection left or right Shift+Left, Shift+Right Shift+Left, Shift+Right Shift+Left, Shift+Right
Extend selection to start or end of line Shift+Home, Shift+End Shift+Home, Shift+End Shift+Home, Shift+End
Extend selection to start or end of text area Ctrl+Shift+Home, Ctrl+Shift+End Ctrl+Shift+Home, Ctrl+Shift+End Ctrl+Shift+Home, Ctrl+Shift+End
Extend selection to previous or next word Ctrl+Shift+Left, Ctrl+Shift+Right Ctrl+Shift+Left, Ctrl+Shift+Right Ctrl+Shift+Left, Ctrl+Shift+Right
Copy selection Ctrl+C Ctrl+C
Cut selection Ctrl+X Ctrl+X
Paste Selected Text Ctrl+V Ctrl+V
Delete next character Delete Delete Delete
Delete previous character Backspace Backspace Backspace
Insert line break Enter Enter Enter
Insert tab Tab Tab Tab
JTextPane
Navigate in Tab Tab Tab
Navigate out Ctrl+Tab Ctrl+Tab
Navigate out backwards Shift+Ctrl+Tab Shift+Ctrl+Tab Shift+Ctrl+Tab
Move up or down a line Up/Down Arrow Up/Down Arrow Up/Down Arrow
Move left or right a component or char Left/Right Arrow Left/Right Arrow Left/Right Arrow
Move up or down one vertical block PgUp/PgDn PgUp/PgDn PgUp/PgDn
Move to start or end of line Home/End Home/End Home/End
Move to previous or next word Ctrl+Left/Right Arrow Ctrl+Left/Right Arrow Ctrl+Left/Right Arrow
Move to start or end of data Ctrl+Home/End Ctrl+Home/End Ctrl+Home/End
Select All Ctrl+A Ctrl+A
Extend selection up one line Shift+Up Arrow Shift+Up Arrow Shift+Up Arrow
Extend selection down one line Shift+Down Arrow Shift+Down Arrow Shift+Down Arrow
Extend selection to beginning of line Shift+Home Shift+Home Shift+Home
Extend selection to end of line Shift+End Shift+End Shift+End
Extend selection to beginning of data Ctrl+Shift+Home Ctrl+Shift+Home Ctrl+Shift+Home
Extend selection to end of data Ctrl+Shift+End Ctrl+Shift+End Ctrl+Shift+End
Extend selection left Shift+Left Arrow Shift+Left Arrow Shift+Left Arrow
Extend selection right Shift+Right Arrow Shift+Right Arrow Shift+Right Arrow
Extend selection up one vertical block Shift+PgUp Shift+PgUp Shift+PgUp
Extend selection down one vertical block Shift+PgDn Shift+PgDn Shift+PgDn
Extend selection left one word Ctrl+Shift+Left Arrow Ctrl+Shift+Left Arrow Ctrl+Shift+Left Arrow
Extend selection right one word Ctrl+Shift+Right Arrow Ctrl+Shift+Right Arrow Ctrl+Shift+Right Arrow
JEditorPane
Note: For more information on how to navigate or move and make selections, see JTextArea.
Move to next HTML link or other focusable element Ctrl+T Ctrl+T Ctrl+T
Note: The 'T' in the above and following two lines means the letter T. It does NOT stand for Tab.
Move to previous HTML link or other focusable element Ctrl+Shift+T Ctrl+Shift+T Ctrl+Shift+T
Activate an HTML link Ctrl+Spacebar Ctrl+Spacebar Ctrl+Spacebar
Navigate out backwards Ctrl+Shift+Tab Ctrl+Shift+Tab Ctrl+Shift+Tab
Move up or down one line Up/Down Arrow Up/Down Arrow Up/Down Arrow
Move left or right one component or char Left/Right Arrow Left/Right Arrow Left/Right Arrow
Move up or down one vertical block PgUp/PgDn PgUp/PgDn PgUp/PgDn
Move to beginning or end of line Home/end Home/end Home/end
Move to previous or next word Ctrl+Left/Right Arrow Ctrl+Left/Right Arrow Ctrl+Left/Right Arrow
Move to beginning or end of data Ctrl+Home/End Ctrl+Home/End Ctrl+Home/End
Move left or right one block Ctrl+PgUp/PgDn Ctrl+PgUp/PgDn
Select All Ctrl+A Ctrl+A
Extend selection up or down one line Shift+Up/Down Arrow Shift+Up/Down Arrow Shift+Up/Down Arrow
Extend selection left or right one component or char Shift+Left/Right Arrow Shift+Left/Right Arrow Shift+Left/Right Arrow
Extend selection to start or end of line Shift+Home/End Shift+Home/End Shift+Home/End
Extend selection to start or end of data Ctrl+Shift+Home/End Ctrl+Shift+Home/End Ctrl+Shift+Home/End
Extend selection up or down one vertical block Shift+PgUp/PgDn Shift+PgUp/PgDn Shift+PgUp/PgDn
Extend selection to previous or next word Ctrl+Shift+Left/Right Arrow Ctrl+Shift+Left/Right Arrow Ctrl+Shift+Left/Right Arrow
Extend selection left or right one block Ctrl+Shift+PgUp/PgDn Ctrl+Shift+PgUp/PgDn Ctrl+Shift+PgUp/PgDn

Containers: Frames, Windows, Panes, and Icons
Metal look and feel keys Windows look and feel keys Motif look and feel keys
JDesktopPane
Navigate forward among open application windows, then desktop icons Alt+Tab Alt+Tab Alt+Tab
Navigate forward among open application windows, then desktop icons Alt+Esc Alt+Esc Alt+Esc
Navigate backward among open application windows, then desktop icons Alt+Shift+Tab Alt+Shift+Tab Alt+Shift+Tab
Navigate forward among open associated windows Ctrl+F6 Ctrl+F6 Ctrl+F6
Navigate backward among open associated windows Ctrl+Shift+F6
Post menu of window options Alt+Spacebar
Post menu of window options Shift+Esc Shift+Esc
Post menu of window options Ctrl+Spacebar Ctrl+Spacebar
Open window (when iconized) Enter Enter Enter
JOptionPane
Retract dialog Esc Esc Esc
Activate the default button (if defined) Enter Enter Enter
JDialog
Retract dialog Esc Esc Esc
Activate the default button (if defined) Enter Enter Enter
JScrollPane
Navigate out forward Tab Tab Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Move up or down Up, down Up, down Up, down
Move left or right Left, Right Left, Right Left, Right
Move to start or end of data Ctrl+Home, Ctrl+End Ctrl+Home, Ctrl+End Ctrl+Home, Ctrl+End
Block move up or down PgUp, PgDn PgUp, PgDn PgUp, PgDn
Block move right Ctrl+PgDn Ctrl+PgDn Ctrl+PgDn
Block move left Ctrl+PgUp Ctrl+PgUp Ctrl+PgUp
JSplitPane
Navigate out forward Tab Tab Tab
Navigate out forward Ctrl+Tab Ctrl+Tab Ctrl+Tab
Navigate out backward Shift+Tab Shift+Tab Shift+Tab
Navigate out backward Ctrl+Shift+Tab Ctrl+Shift+Tab Ctrl+Shift+Tab
Move between panes Tab Tab Tab
Move between panes F6 F6 F6
Move to splitter bar F8 F8 F8
Resize pane vertical Up, Down Up, Down Up, Down
Resize pane horizontal Left, Right Left, Right Left, Right
Resize to min or max Home, End Home, End Home, End
JTabbedPane
Navigate in Tab Tab Tab
Navigate out Ctrl+Tab Ctrl+Tab Ctrl+Tab
Move to tab left or right left, Right left, Right left, Right
Move to tab above or below Up, Down Up, Down Up, Down
Move from tab to page Ctrl+Down Ctrl+Down Ctrl+Down
Move from page to tab Ctrl+Up Ctrl+Up Ctrl+Up
Move from page to previous page Ctrl+PgUp Ctrl+PgUp Ctrl+PgUp
Move from page to next page Ctrl+PgDn Ctrl+PgDn Ctrl+PgDn
JFrame
Navigate out Alt+Esc Alt+Esc Alt+Esc
Display window menu Alt+Spacebar Alt+Spacebar Alt+Spacebar
Activate the default button (if defined) Enter Enter Enter
JInternalFrame
Open (Restore) Ctrl+F5 Ctrl+F5 Ctrl+F5
Open (Restore) Alt+F5 Alt+F5 Alt+F5
Open (Restore) Enter Enter Enter
Close Ctrl+F4 Ctrl+F4 Ctrl+F4
Close Alt+F5 Alt+F5 Alt+F5
Move Ctrl+F7 Ctrl+F7 Ctrl+F7
Move Alt+F7 Alt+F7 Alt+F7
Resize Ctrl+F8 Ctrl+F8 Ctrl+F8
Resize Alt+F8 Alt+F8 Alt+F8
Minimize Ctrl+F9 Ctrl+F9 Ctrl+F9
Minimize Alt+F9 Alt+F9 Alt+F9
Display window menu Alt+Spacebar Alt+Spacebar Alt+Spacebar
Activate the default button (if defined) Enter Enter Enter
JWindow
Activate the default button (if defined) Enter Enter Enter



Back to top


Document options

Document options requiring JavaScript are not displayed


Related information
General SDK FAQs
Newsgroups
Future plans

Special offers
Using workspaces demo with Rational System Architect
Get your technical questions answered in Forums
Redefine how you work smarter Impact 2010

More offers