Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8020752

[macosx] Cursor position in JTextArea does not match insertion point in Retina displays

XMLWordPrintable

      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 ----------

            serb Sergey Bylokhov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: