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

Regression: pasting null does not delete the selected text in text component

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 5.0
    • client-libs
    • x86
    • linux_redhat_8.0


      pasting null to text area or text field does not delete the selected text.

      On solaris the selected text gets deleted with XAWT option.
      On Linux8 (redhat) the selected text will not be deleted with tiger b17 but gets deleted with jdk 1.4.2 (b27). This is regression from 1.4.2

      test case:

      import java.awt.*;
      import java.awt.datatransfer.*;

      public class Test {
          public static void main(String[] args) {
              Frame frame = new Frame();
              frame.setBounds(50, 50, 200, 200);
              frame.setLayout(new GridLayout());
              frame.add(new TextArea("textarea"));
              frame.add(new TextField("textField"));
              Toolkit.getDefaultToolkit().getSystemClipboard().setContents
                  (new StringSelection(null), null);
              frame.show();
          }
      }



      Steps to reproduce:
      1. Compile and run the above program.
      2. select few leters in text area and try to paste (using ctrl+V).
      3. Selected text will not be deleted with tiger b17 but gets deleted with jdk 1.4.2
      4. Repeat step 2 for text field, result is same as step 3.
       

            dassunw Das Das (Inactive)
            asamjisunw Aruna Samji (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: