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

JTextField, JTextArea and JEditorPane dont receive text input in privileged mode

    Details

      Description

      FULL PRODUCT VERSION :
      java -version "1.7.0_55"
      Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
      Java Hotspot(TM) 64-Bit Server VM(build 24.55-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      OSX 10.9.2 Darwin kernel version 13.1.0

      A DESCRIPTION OF THE PROBLEM :
      When a java swing program is run using authenticated mode (or privileged mode), then the JTextField, JTextArea and JEditorPane always ends up being in a mode that does not receive any keyboard events.

      I even doubt any swing component receives keyboard events at all. All of them seem to respond to mouse events.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Write a simple java swing program. In this program you have to just launch a JOptionPane.showInputDialog(this,"Hello World")

      2. Package this program into a JAR say "Test.jar", so that can run using java -jar "Test.jar"

      3. Refer https://developer.apple.com/library/mac/samplecode/EvenBetterAuthorizationSample/Introduction/Intro.html on how to build an XCode Application for running an operation in authenticated mode.

      4. You can just download the sample and modify one of the methods which do privileged operations to launch this java Test.jar. Note that this modification is to be done in the XCode environment. You can use an NSTask with arguements as java -jar Test.jar
      Also note that sometimes the GUI does not launch, just use a -Dawt.toolkit=sun.lawt.macosx.LWCToolkit

      5. Build the application

      6. Launch the application in a MacOSX machine under a standard-user. The authentication dialog will popup. Now enter the administrator credentials.

      7. This will install the helper tool and then launch the java application.

      8. When you do this, you will find that the text boxes are always disabled and do not receive keyboard events

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      All textfields should receive keyboard events.
      ACTUAL -
      All textfields, text area, jeditorpane dont seem to be receiving text events at all.

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: