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

Font sizes in JDK1.4 differ in table cells for editing and rendering

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.0
    • client-libs



      Name: sv35042 Date: 10/08/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION : Microsoft Windows XP
      [Version 5.1.2600]


      ADDITIONAL OPERATING SYSTEMS : Windows NT/2000



      A DESCRIPTION OF THE PROBLEM :
      Since JDK 1.4 beta, when I click in my table cells to edit
      (they use JTextFields for both editing and rendering) the
      font size increases slightly. This shifts all the
      characters to the right, and the insertion cursor is then
      inserted in the wrong place!

      This is very aggravating for users, as they watch the text
      jump a little when they click in a table cell.

      This seems to occur with all Windows versions, but did NOT
      occur in 1.3.

      REGRESSION. Last worked in version 1.3.1

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Create a table with JTextField editor and renderer.
      2. Click in the text field to start editing.
      3.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      I expect the cursor to be put between the two characters on
      which I click, but since the font size changes, the cursor
      gets inserted in the wrong place!

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.*;

      public class Test {
      public static void main(String[] args) throws Exception {
      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName
      ());
      JFrame frame = new JFrame("Bad Font Sizes in JTextField");
      String[][] data = new String[][] { { "Looooooooooong Row
      1", "Looooooooooong Value 1" }, { "Looooooooooong Row 2", "Looooooooooong Value
      2" }};
      JTable table = new JTable(data, new String[] { "Header
      1", "Header 2" });
      frame.getContentPane().add(table);
      frame.pack();
      frame.setVisible(true);
      }
      }

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

      CUSTOMER WORKAROUND :
      Use JDK 1.3.
      (Review ID: 143271)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            svioletsunw Scott Violet (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: