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

JTextField with setEditable(false) doesn't scroll

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.2.0
    • 1.1.5
    • client-libs
    • swing1.0fcs
    • x86
    • windows_nt



      Name: dgC58589 Date: 01/05/98


      In swing-0.6.1, when using a JTextField and
      the text is longer than the field width, you can
      scroll the text left and right using the arrows
      keys. However, when setting the textfield to
      non-editable using 'setEditable(false)', not only
      the text edit feature gets disabled as expected, but in addition scrolling doesn't work anymore.

      import com.sun.java.swing.*;
      import com.sun.java.swing.text.*;
      import java.awt.*;
      import com.sun.java.swing.*;
      import com.sun.java.swing.text.*;
      import java.awt.*;

      public class Foo {
          public static
          void main(String args[]) {
              JTextField fld;
              Frame f = new Frame();
              f.setLayout(new BorderLayout());
              f.add( fld = new JTextField("Hello World ! This is a really long text"), "West" );
              fld.setEditable( false );
              f.setSize(100, 50);
              f.show();
          }
      }

      (Review ID: 22321)
      ======================================================================

            tprinzing Tim Prinzing (Inactive)
            dgrahamcsunw David Graham-cumming (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: