JDK-6882912 : Strange behaviours when typing @ or '
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,windows_xp,windows_vista
  • CPU: generic,x86
  • Submitted: 2009-09-17
  • Updated: 2011-02-16
  • Resolved: 2010-02-16
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 Availabitlity Release.

To download the current JDK release, click here.
JDK 7
7 b84Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b71)
Java HotSpot(TM) Client VM (build 16.0-b08, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [version 6.0.6002]

A DESCRIPTION OF THE PROBLEM :
Typing a @ in a JTextArea when running over JRE7 delete the following character. Typing a ' first move the cursor to the next character then insert '

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
run the following code with JRE7b71 then insert a few blank lines (say 3 times) then type 'test', then type @  on the first line, set the cursor between the e and s of test then type '

import java.awt.Dimension;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
public class Main {
    public static void main(String[] args) {
      JTextArea jta = new JTextArea();
      jta.setPreferredSize(new Dimension(200, 200));
      JOptionPane.showMessageDialog(null, jta);
    }
}


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The content of the JTextArea should be:
@


te'st
ACTUAL -
The content of the JTextArea is:
@

tes't

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Dimension;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;
public class Main {
    public static void main(String[] args) {
      JTextArea jta = new JTextArea();
      jta.setPreferredSize(new Dimension(200, 200));
      JOptionPane.showMessageDialog(null, jta);
    }
}

---------- END SOURCE ----------

Release Regression From : 6u13
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION Problem is due to a stray line in the ExtendedKeyCodes.java. There should be some cleanup in this table.
2010-02-08

EVALUATION I reproduced even more strange problem: - type anything in the textfield in the provided testcase - return the caret to the very beginning - type " several times - you'll see that the " symbol overrides the previously typed text This behavior is not specific to the textArea inside the JOptionPane, please refer to the follwing test case: import javax.swing.*; public class Main { public static void main(String[] args) { JTextArea jta = new JTextArea(); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(jta); frame.setSize(200, 200); frame.setVisible(true); } } accepted and upgraded
2009-10-01