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

TextField does not display native popup menu on Windows

XMLWordPrintable

    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      All java-versions from 1.7 onwards, for example:
      java version "1.7.0_65"
      Java(TM) SE Runtime Environment (build 1.7.0_65-b19)
      Java HotSpot(TM) Client VM (build 24.65-b04, mixed mode, sharing)
      and
      java version "1.8.0_11"
      Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
      Java HotSpot(TM) Client VM (build 25.11-b03, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      All Windows versions (x86/x64), for example:
      Microsoft Windows XP [Version 5.1.2600]
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      Since java-version 1.7 the awt.TextField does not display the native popup menu on Windows, if the right mouse button is clicked. In java-versions until 1.7 the same native popup menu on Windows is displayed when the user clicks with the right mouse button in an awt.TextField and in an awt.TextArea. The behavior of awt.TextField and awt.TextArea regarding the right mouse click should be the same.
      Please use the same Windows Rich Edit version for the TextField and TextArea, which behaves like the old Windows Edit version in former java-versions.

      REGRESSION. Last worked in version 6u45

      ADDITIONAL REGRESSION INFORMATION:
      All java-versions until 1.7, for example:
      java version "1.6.0_03"
      Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
      Java HotSpot(TM) Client VM (build 1.6.0_03-b05, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile the example program with java 1.6, run it on Windows with java 1.6, 1.7 and 1.8 and click with the right mouse button on the TextField and the TextArea.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      With all java-versions on Windows you should see the same native popup menu for TextField and TextArea.
      ACTUAL -
      Beginning with java-version 1.7 (including 1.8) the native Windows popup menu is only displayed on an awt.TextArea and not on the awt.TextField. In older java-versions (including 1.6) you see the same native popup menu for TextField and TextArea.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.*;

      public class TextFieldBug extends Frame
      {
        public TextFieldBug()
        {
      this.setLayout(new GridLayout(2, 1, 5, 5));

      TextField myTextField = new TextField("Something");
      TextArea myTextArea = new TextArea("Something");

      this.add( myTextField );
      this.add( myTextArea );
         }

         public static void main(String[] args)
        {
      TextFieldBug myTextFieldBug = new TextFieldBug();
      myTextFieldBug.pack();
      myTextFieldBug.setVisible( true );
        }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Implement the native popup menu functionality for awt.TextField by yourself.
      But it is not possible to duplicate the native Windows style. There will ever be a difference between the implemented popup menu of TextField and native popup menu of TextArea.

            amalinko Artem Malinko (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: