JDK-6707045 : Trying to delete tab character locks up JTextPane and JEditorPane
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-05-26
  • Updated: 2011-02-16
  • Resolved: 2008-11-21
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 JDK 7
6u14Resolved 7Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
5.1.2600

A DESCRIPTION OF THE PROBLEM :
If you enter a tab character in a JTextPane then select it and press Enter to delete it the application locks up.

The tab should have some text before it and some text after it.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
This test code below shows problem. The same happens with a JTextPane

Run test code
Put cursor on line between ���1��� and ���2���
Press Tab
Select Tab
Press Enter
Application locks up with Java 6. Java 5 is ok.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should be able to continue editing.
ACTUAL -
Application containing JTextPane is frozen.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class TabBug extends javax.swing.JDialog
{

  public TabBug(java.awt.Frame parent)
  {
    super(parent, true);
    initComponents();
  }

  private void initComponents()
  {

    javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
    javax.swing.JEditorPane editPane = new javax.swing.JTextPane();

    editPane.setText("1\n\n2");
    jScrollPane1.setViewportView(editPane);

    add(jScrollPane1);


    pack();
  }

  public static void main(String args[])
  {
    TabBug dialog = new TabBug(new javax.swing.JFrame());
    dialog.setVisible(true);
  }
}

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

CUSTOMER SUBMITTED WORKAROUND :
None found so far.

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

Comments
EVALUATION This is a real bug, all Swing Gui locks up I checked that it also happens if we run Swing from the Evend Dispatch Thread, see test case below The priority is upgraded to draw attention to this issue import javax.swing.*; public class TabBug extends JFrame { public TabBug() { JScrollPane jScrollPane1 = new JScrollPane(); JEditorPane editPane = new JTextPane(); editPane.setText("1\n\n2"); jScrollPane1.setViewportView(editPane); add(jScrollPane1); pack(); } public static void main(String args[]) { SwingUtilities.invokeLater(new Runnable() { public void run() { TabBug dialog = new TabBug(); dialog.setVisible(true); } }); } }
30-05-2008