JDK-6361367 : REGRESSION: REGRESSION: Backspace key does not delete when Shift is pressed
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2005-12-09
  • Updated: 2011-02-16
  • Resolved: 2006-04-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b80Fixed
Related Reports
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b60)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b60, mixed mode, sharing)

and:
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)


worked with:
java version "1.4.2_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_06-b03)
Java HotSpot(TM) Client VM (build 1.4.2_06-b03, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
Linux ce 2.6.13-1.1526_FC4 #1 Wed Sep 28 19:15:10 EDT 2005 i686 i686 i386 GNU/Linux
Windows XP

EXTRA RELEVANT SYSTEM CONFIGURATION :
X Window System Version 6.8.2
  Release Date: 9 February 2005
X Protocol Version 11, Revision 0, Release 6.8.2
Build Operating System: Linux 2.6.9-22.ELsmp i686 [ELF]
Current Operating System: Linux ce 2.6.13-1.1526_FC4 #1 Wed Sep 28 19:15:10 EDT 2005 i686
Build Date: 21 September 2005
Build Host: hs20-bc1-6.build.redhat.com
        Before reporting problems, check http://wiki.X.Org
        to make sure that you have the latest version.
Module Loader present
OS Kernel: Linux version 2.6.13-1.1526_FC4 (###@###.###) (gcc version 4.0.1 20050727 (Red Hat 4.0.1-5)) #1 Wed Sep 28 19:15:10 EDT 2005

A DESCRIPTION OF THE PROBLEM :
In JTextFields and JTextAreas when pressing with backspace and shift nothing happens.
XAWT's TextFields/Areas don't show this problem, it also works with older versions of java (1.4.2).

Since this worked in the past and its absolutly not common to ignore backspace key-events while shift is pressed (also native programs delete under these circumstances) I open up this bug-report.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.) Open a Swing application that uses JTextField or JTextArea
2.) Write some text into the TextFields
3.) Keep the shift-key pressed (the key with the arrow-up, 2 keys under tab on german layout) and press backspace

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
delete one char per backspace press
ACTUAL -
nothing happens

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.swing.*;        

public class swing1{

	private static void createAndShowGUI() {
        JFrame frame = new JFrame("Test Swing Application");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JTextField tf = new JTextField("Hello There");
        frame.getContentPane().add(tf);
		frame.pack();
		frame.setSize(200,200);
        frame.setVisible(true);
    }

    public static void main(String[] args) {
                createAndShowGUI();
    }
}
---------- END SOURCE ----------


CUSTOMER SUBMITTED WORKAROUND :
use java-1.4.2

Release Regression From : 1.4.2_10
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

Release Regression From : 1.4.2_10
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

Comments
EVALUATION The JTextField instance in the test does not contain KeyStroke [shift pressed BACK_SPACE] in its InputMap. It can be chacked in JComponent.processKeyBinding() method. KeyStroke [pressed BACK_SPACE] is present, so it leads to correct javax.swing.text.DefaultEditorKit$DeletePrevCharAction.actionPerformed() call when [Shift] is not pressed.
17-01-2006