United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7124283 [macosx] Can't move focus out of a table with the keyboard.
JDK-7124283 : [macosx] Can't move focus out of a table with the keyboard.

Details
Type:
Bug
Submit Date:
2011-12-23
Status:
Closed
Updated Date:
2013-09-11
Project Name:
JDK
Resolved Date:
2012-03-23
Component:
client-libs
OS:
os_x
Sub-Component:
java.awt
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u4
Fixed Versions:
7u4 (b11)

Related Reports
Duplicate:
Relates:

Sub Tasks

Description
http://java.net/jira/browse/MACOSX_PORT-658 submitted 2011/11/03 by Pete Brunet

.SUMMARY
Can't move focus out of a table with the keyboard.
.STEPS TO REPRODUCE
1. cd ~/OpenJDK/macosx-port/build/macosx-universal/
2. bin/java -jar /Library/Java/Demos/JFC/SwingSet2/SwingSet2.jar
3. Press the tab key until focus is on the fourteenth button (Table demo).
4. Press the space bar to activate the Table demo.
5. Press the tab key repeatedly until focus is on the table.
6. Be sure the focus is on the upper left cell.
6. Press shift + control + tab
.RESULTS
Focus should move out of the table back to the row height slider
.VERSION
OS:  Mac OS X version 
Java:  (from "java -version") 
.REGRESSION
Provide information on steps taken to isolate the problem.
Describe circumstances where the problem occurs or does not occur,
such as software versions and/or hardware configurations.
.NOTES
This works OK on Windows
According to the following link shift + control + tab is the correct shortcut: <span class=&quot;nobr&quot;><a href=&quot;http://support.apple.com/kb/ht1343&quot;>http://support.apple.com/kb/ht1343<sup><img class=&quot;rendericon&quot; src=&quot;/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/></sup></a></span>

                                    

Comments
EVALUATION

Author: Artem Ananiev Date: 07/Nov/11 04:15 PM
Does it work for components other than JTable?
 
Author: Pete Brunet Date: 28/Nov/11 10:06 PM
JTable is the only control I am aware of that you can get stuck in just using tab or shift tab, i.e. tab or shift tab at the last/first cell wraps to the beginning/end.  Using ctrl shift tab to get back out of the first cell:
On Win with Java 1.7.0_01, works OK with all L&amp;Fs
On Mac with Java 1.6.0_29, works OK with all L&amp;Fs
On Mac with JDK7 b218, nothing happens with all L&amp;Fs
 
Author: Pete Brunet Date: 06/Dec/11 03:44 PM
I see the same problem not being able to get out of an editable text area.  If you are in an editable text area pressing tab will insert a tab into the text and ctrl tab is needed to get out of the text field.  That works OK with JDK 6 but not JDK 7. To see this use the TextSamplerDemoProject found on this page: 
<span class=&quot;nobr&quot;><a href=&quot;http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html&quot;>http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html<sup><img class=&quot;rendericon&quot; src=&quot;/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/></sup></a></span>
The direct link is:
<span class=&quot;nobr&quot;><a href=&quot;http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-TextSamplerDemoProject.zip&quot;>http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-TextSamplerDemoProject.zip<sup><img class=&quot;rendericon&quot; src=&quot;/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/></sup></a></span>
After building the project with NetBeans here is a typical invocation:
cd /Library/Java/JavaVirtualMachines/JDK\ 1.7.0\ Developer\ Preview.jdk/Contents/Home/
bin/java -cp &quot;/Users/petebrunet/Java Samples/components-TextSamplerDemoProject/dist/TextSamplerDemo.jar&quot; components.TextSamplerDemo
The text area labeled Plain Text is editable.
 
Author: Anton Tarasov Date: 16/Dec/11 02:07 PM
I see that nor &quot;ctrl+tab&quot;, nor &quot;ctrl+shift+tab&quot; works for any control. (It works with Apple's java)
 
Author: Anton Tarasov Date: 21/Dec/11 01:09 PM
When I press CTRL, holding it and then press TAB, nothing is called on the native level for the TAB key down event. The reason is that for a key press with a modifier cocoa calls the performKeyEquivalent method, not the keyDown one. The method is simply not implemented in AWTView.m.
Here's the webrev: <span class=&quot;nobr&quot;><a href=&quot;http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/&quot;>http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/<sup><img class=&quot;rendericon&quot; src=&quot;/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/></sup></a></span>
The fix also suggests an additional change. It's to remove a modification of a key char value in a key press event with a modifier (CTRL/SHIFT):
<span class=&quot;nobr&quot;><a href=&quot;http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java.udiff.html&quot;>http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java.udiff.html<sup><img class=&quot;rendericon&quot; src=&quot;/jira/images/icons/linkext7.gif&quot; height=&quot;7&quot; width=&quot;7&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/></sup></a></span>
This change is currently under discussion with the author of the workaround (and so it may be not a final version).
                                     
2011-12-23
EVALUATION

Backing out the change in CPlatformView.java, because of this:

http://java.net/jira/browse/MACOSX_PORT-568


new webrev: http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.2/webrev/
                                     
2011-12-23
Edited affected version because this bug was marked bu aurora as "Not fixed"
                                     
2013-09-11



Hardware and Software, Engineered to Work Together