JDK-4513164 : Problem with cursor and focus in table editors based on JTextField
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 2001-10-10
  • Updated: 2016-02-16
  • Resolved: 2016-02-16
Related Reports
Relates :  
Relates :  
Description
Comments from a CAP member regarding the fix for bug#4274963/4256006:
---------------------------------------------------------------------

We can divide usage of tables into 2 categories:
- row oriented, where users navigate more frequently horizontally 
- column oriented, where users navigate rather vertically 

Unlike Excel, java applications are in most situations
database oriented which implies row oriented style and need for 
horizontal navigation. That is why I understand You want to preserve
horizontal arrow keys. But why not use Enter? In JDK 1.3.x Enter moves
cell selecttion into the next row, wchich does not corespond with row 
oriented style. More logically would be next (right) cell. If user
wants move down, he can safely use vertical arrow key. 

I propose following:
- set default surrendersFocusOnKeystroke to TRUE
- add method "setShouldEnterMoveRight" with default value to TRUE

Editing of existing data is very frequently operation. Current
situation absolutely does not help users - thay have to double click
too frequently. By Java comunity it is perceived as bug, so I would
urge to reconsider backward compatibility. Everybody will be happy -
You even don't need to make survey - see comments on Bug Parade 
and Java Lobby.


###@###.### 2001-10-10
===============================

Comments
Not application any more
16-02-2016

SUGGESTED FIX The idea is to request focus in addNotify() method of JTextField. Code in JTable.java could be following: static class GenericEditor extends DefaultCellEditor { public GenericEditor() { super( new JTextField() { public void addNotify() { super.addNotify(); requestFocus(); } }); } ...
25-09-2004

EVALUATION Maintaining backwards compatability/functionality is important so the suggestion to make surrenersFocusOnKeystroke default to TRUE cannot be performed. The suggestion of a new property alogn the lines of setShouldEnterMoveRight soulds like a good addition. In order to maintain backward compatability, this would need to default to FALSE, however. ###@###.### 2001-10-24
24-10-2001