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

Pasting null does nothing to a TextArea, but clears TextField selection

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.2
    • 1.4.0
    • client-libs
    • None
    • mantis
    • x86, sparc
    • solaris_8, windows_nt

      Date: Sat, 30 Dec 2000 16:56:05 +0300
      From: "Danila A. Sinopalnikov" <###@###.###>
      To: David Mendenhall <###@###.###>
      Cc: ###@###.###
      Subject: Re: Fix for 4250859

      [...]

      There is one inconsistency in handling null return value of
      Transferable.getTransferData():

      MTextAreaPeer.pasteFromClipboard() does nothing if getTransferData() returns
      null, while MTextFieldPeer.pasteFromClipboard() and
      MFileDialogPeer.pasteFromClipboard() delete the currently selected text.

      [...]

      Danila.

      =====
      I have verified that this same inconsistency exists on Windows. The following
      test case can be used to reproduce the inconsistency. Paste into the Components
      using:
        Solaris-- Paste key
        Windows-- CTRL-V or the popup context menu (right mouse click)

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

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

      david.mendenhall@east 2001-01-04

            agerasimsunw Alexander Gerasimov (Inactive)
            dmendenhsunw David Mendenhall (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: