JDK-8020752 : [macosx] Cursor position in JTextArea does not match insertion point in Retina displays
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7u40,8
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: os_x
  • Submitted: 2013-07-17
  • Updated: 2013-07-18
  • Resolved: 2013-07-18
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version  " 1.8.0-ea " 
Java(TM) SE Runtime Environment (build 1.8.0-ea-b97)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b39, mixed mode)

and

java version  " 1.7.0_40-ea " 
Java(TM) SE Runtime Environment (build 1.7.0_40-ea-b29)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b48, mixed mode)


ADDITIONAL OS VERSION INFORMATION :
MacOS X 10.8.3

A DESCRIPTION OF THE PROBLEM :
This is really the same problem reported in bug 8014069, but I'm reporting it again because that other bug has been marked a duplicate of 7190349 which is about rotated text, and that isn't the problem here.  This problem occurs with unrotated text.

The bug was introduced 1.7.0_40 when the blurry fonts problem (8000629) was fixed.

REGRESSION.  Last worked in version 7u25

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run this, position the cursor in one of the text fields, and use the arrow keys to move the mouse left and right.  It will overlap some of the characters.  The problem gets worse the longer the line.




REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Font;

import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.WindowConstants;

public class JTextfieldDemo {

    public static void main(String[] args) {

        JFrame frame = new JFrame(  "  JTextfield Demo  "  );
        Container contentPane = frame.getContentPane();
        contentPane.setLayout(new FlowLayout());
        final JTextField tf1 = new JTextField(  "  1.2.3.4.5.6.7.8  "  );
        final JTextField tf2 = new JTextField(  "  1-2-3-4-5-6-7-8  "  );
        final Font font = new Font(tf1.getFont().getName(), tf1.getFont().getStyle(), 11);
        tf1.setFont(font);
        tf2.setFont(font);
        contentPane.add(tf1);
        contentPane.add(tf2);
        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);

    }

}

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