JDK-4759422 : RFE: The anchor should not be the same as the focus in a JTable
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2002-10-08
  • Updated: 2003-08-08
  • Resolved: 2003-08-08
Related Reports
Duplicate :  
Relates :  
Description

Name: jk109818			Date: 10/07/2002


FULL PRODUCT VERSION :
java version "1.4.1-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b14)
Java HotSpot(TM) Client VM (build 1.4.1-beta-b14, mixed mode)

FULL OPERATING SYSTEM VERSION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
This can be demonstrated in the SwingSet. In the JTable
section, select a row, then press the down arrow while
holding down the shift key. The focus stays at the anchor
point instead of moving down with the selection. The focus
should be moving down. Try the same thing in the Windows
Explorer (Details view). You'll see that the focused cell
moves when pressing shift+down or shift+up.  The behavior
should be conform to Windows standard (at least in Windows
look-n-feel).

This is especially annoying when, after pressing
shift+down a few times, shift is released and you press
down once more. You would expect the new currently
selected row to be just below the previously selected row.
Instead, it's the one just below the previous anchor
point. This just doesn't seem right...

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER WORKAROUND :
I tried a number of workarounds (such as subclassing
changeSelection(), adding custom key listeners, etc.) and
got no where. This is hard to work around since everyone
assumes that the focus is the same as the anchor, which it
shouldn't be. In the end, I just left the default behavior.
(Review ID: 165215) 
======================================================================

Comments
EVALUATION This will most likely be addressed when 4303294 is fixed. Committing to tiger. ###@###.### 2003-06-24 This bug has been fixed as part of 4303294 for tiger. JTable will now treat the lead as the focused cell. This addresses the issues presented in this bug report. Selection behavior should now be more familiar, and will be consistent with JList and JTree. Although this isn't a duplicate problem, I am closing it as such since the fix was made under 4303294. ###@###.### 2003-08-08
08-08-2003