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

setMargin() on JTextField messes up view when text extends beyond component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.1.7
    • client-libs
    • merlin
    • generic
    • generic



      Name: vi73552 Date: 04/13/99


      I'm trying to put a small left margin in my
      text field. This works however when I type
      more text than can fit in the field's width
      and then press HOME, the view gets messed up
      and tries to draw text as if the margin was
      not set. This is using Swing1.1.1beta1 under
      JDK1.1.7

      Run the following test program. Type
      "01234567890abcedefg" and so on until textfield
      starts to scroll. Now press HOME key. Notice
      that the initial "01.." is cut off.

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

      class Test extends JFrame
      {
          Test() {
              super("Test");

              JTextField field = new JTextField(8);
              field.setMargin(new Insets(0,10,0,0));
              getContentPane().add(field);
              pack();
              show();
          }

          public static void main(String[] args) {
              new Test();
          }
      }
      (Review ID: 56870)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: