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

setEditable(false) but can still backspace to delete text.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.5
    • 1.1.2
    • client-libs
    • None
    • 1.1.5
    • generic
    • windows_95
    • Not verified

      7/18/97 cah filed for Doug Leeper, ISA Services, Inc.


      Create a JTextField and place in a container of your choice.
      Set the edit state to false (setEditable( false ))

      Select the text in the field and press backspace. The text is deleted. This shouldn't happen. All other key inputs are disabled.

      Here is my sample code:

      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") );
              fld.setEditable( false );
              f.setSize(200, 200);
              f.show();
          }
      }

            tprinzing Tim Prinzing (Inactive)
            cahorton Catherine Horton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: