JDK-4908060 : First character in text field gets cut ('j' appears as 'i')
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-08-18
  • Updated: 2022-09-14
  • Resolved: 2022-09-14
Related Reports
Relates :  
Description

Name: dk106046			Date: 08/18/2003

Letter 'j' typed as first character in text field looks like 'i'. 'W' get cut-off in labels.The problem appears to be present in both text fields and labels. I'm not sure if other letters are affected as well.  

Here is the testcase TextFieldTypingJProblem.java

import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;

import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import com.sun.java.swing.plaf.motif.MotifLookAndFeel;

public class TextFieldTypingJProblem {
       public static void main(String[] args)
       {
              Try 
        {
            UIManager.setLookAndFeel(new WindowsLookAndFeel());
                }
        catch (Exception e)
        {
        
        }
        
  final JFrame frame = new JFrame("TEST");

  JTextField tf = new JTextField("ji -- the j in first position is cut off making it look like i instead of j");

   JLabel l2 = new JLabel("Whis is the label:");
        frame.getContentPane().setLayout(new FlowLayout());
        frame.getContentPane().add(tf);
        frame.getContentPane().add(l2);

        frame.pack();
              frame.setSize(640, 480);
              frame.setVisible(true);
       }
}
======================================================================

Comments
WORK AROUND Name: dk106046 Date: 08/18/2003 java -Dswing.useSystemFontSettings=false TextFieldTypingJProblem ======================================================================
24-09-2004

EVALUATION In 1.5 all j's with Microsoft Sans Serif look like i's. This is likely do to bug 4924220. Until 4924220 is fixed, there isn't anything for Swing to do. I did look at the left side bearing, and it is 1, meaning that Swing isn't clipping the j. ###@###.### 2003-09-29
29-09-2003