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&Fs
On Mac with Java 1.6.0_29, works OK with all L&Fs
On Mac with JDK7 b218, nothing happens with all L&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="nobr"><a href="http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html">http://docs.oracle.com/javase/tutorial/uiswing/examples/components/index.html<sup><img class="rendericon" src="/jira/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>
The direct link is:
<span class="nobr"><a href="http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-TextSamplerDemoProject.zip">http://docs.oracle.com/javase/tutorial/uiswing/examples/zipfiles/components-TextSamplerDemoProject.zip<sup><img class="rendericon" src="/jira/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></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 "/Users/petebrunet/Java Samples/components-TextSamplerDemoProject/dist/TextSamplerDemo.jar" components.TextSamplerDemo
The text area labeled Plain Text is editable.
Author: Anton Tarasov Date: 16/Dec/11 02:07 PM
I see that nor "ctrl+tab", nor "ctrl+shift+tab" 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="nobr"><a href="http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/">http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/<sup><img class="rendericon" src="/jira/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></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="nobr"><a href="http://cr.openjdk.java.net/~ant/MACOSX_PORT-658/v.1/webrev/src/macosx/classes/sun/lwawt/macosx/CPlatformView.java.udiff.html">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="rendericon" src="/jira/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>
This change is currently under discussion with the author of the workaround (and so it may be not a final version).
|