JDK-6665820 : JTextPane frozen after selection of a line content+Enter
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2008-02-21
  • Updated: 2011-02-16
  • Resolved: 2008-05-22
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Linux l-phenix1 2.6.17-10mdv #1 SMP Fri Feb 2 15:53:02 MST 2007 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz GNU/Linux
Windows XP 5.1.2600

A DESCRIPTION OF THE PROBLEM :
A simple editor JTextPane in a JScrollPane.

Type some text on several lines.
On one line, put ONLY two spaces. Select them (don't select carriage return).
Press enter.

Editor is frozen.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
See description.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should delete the selection and replace by new line.
ACTUAL -
Editor is frozen

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class NewJFrame
    extends javax.swing.JFrame
{
  public static void main(String[] p)
  {
    java.awt.EventQueue.invokeLater(new Runnable()
    {
      public void run()
      {
        NewJFrame f = new NewJFrame();
        f.setVisible(true);
        f.setSize(400, 400);
      }
    });
  }

  /** Creates new form NewJFrame */
  public NewJFrame()
  {
    initComponents();
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
    javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
    javax.swing.JTextPane jTextPane1 = new javax.swing.JTextPane();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jPanel1.setLayout(new java.awt.GridBagLayout());

    jTextPane1.setText("aa\nbb\nSelect the two space characters on the next line\n  \nthen press ENTER (don't select the carriage return)\n==> Editor is frozen");
    jScrollPane1.setViewportView(jTextPane1);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    jPanel1.add(jScrollPane1, gridBagConstraints);

    getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);

    pack();
  }// </editor-fold>
  // Variables declaration - do not modify
  // End of variables declaration
}

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

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

Comments
EVALUATION I reproduced this bug on the latest JDK 7, assigned to the text team
11-03-2008