JDK-8041990 : [macosx] Language specific keys does not work in applets when opened outside the browser
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 7u55,8,9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2014-04-25
  • Updated: 2015-04-07
  • Resolved: 2014-06-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 JDK 9
7u67Fixed 8u31Fixed 9 b22Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
Mac:
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)

Windows:
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) Client VM (build 24.55-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Mac:
Darwin myname 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr  2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64

Windows:
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
Nothing happens when pressing language specific characters on the keyboard in anything opened outside the browser from within a applet.

When trying to enter the swedish characters "������������" in for example a component that resides within a JDialog or in a JOptionPane.showInputDialog nothing happens. No character is shown and no error message in the applet console. 

The problem does not occur if you enter the same characters in a Textfield/JTextField where the component is directly in the browser/applet. 

It seems the problem is only related to MAC since the following tests has been done:

OS						Browser									JRE 7u51	JRE 7u55		JRE 7u60 b15 (early access)
------------------------------------------------------------------------------------------------------------------------
MAC (10.9.2 b13C1021) 	Safari (Version 7.0.3 (9537.75.14)) 	Works		Does not work	Does not work
MAC (10.9.2 b13C1021) 	Firefox (28.0)							Works		Does not work	Does not work
Windows	(6.1.7601)		IE (11.0.9600.16428)					Works		Works			-
						Firefox (28.0)							Works		Works			-
Linux (3.8.0-39)		Firefox	(28.0)							Works		Works			-

REGRESSION.  Last worked in version 7u51

ADDITIONAL REGRESSION INFORMATION: 
Mac:
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Goto to the URL: http://www.sitevision.se/java_bugreport_applet/TestApplet.html
2. Switch to a Swedish keyboard and enter the characters ������������ in the JTextField that resides directly in the applet. It works fine.
3. Click on the button "Open a jDialog". Try to enter the same characters in the JTextField that is opened in the JDialog. Nothing happens.
4. Close the dialog and click on the button "Open a jOptionPane". Try to enter the same characters in the input field. Nothing happens.

If you want to build your own applet the source code to the applet can be found further down (excluded the building/signing of the applet). 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
As described above I expect that "������������" should be shown in the JDialog and JOptionPane as when entered directly in the browser.
ACTUAL -
Nothing happens when pressing the "������������" keys on the keyboard in the JDialog and JOptionPane. Workd when done directly in the browser.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
None. Nothing is shown in the applet console even with debug set to level 5.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
// Excluded code for building/signing the applet 
package test.applet;

import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.WindowConstants;
import javax.swing.border.Border;

public class MyApplet extends Applet
{
   JButton jDialogButton = new JButton();
   JButton jOptionPaneButton = new JButton();
   JTextField inputLine = new JTextField(15);

   public MyApplet()
   {
      jDialogButton.setText("Open a jDialog");
      jDialogButton.addActionListener(new JDialogButtonListener());

      jOptionPaneButton.setText("Open a jOptionPane");
      jOptionPaneButton.addActionListener(new JOptionPaneButtonListener());

      inputLine.addActionListener(new TextFieldListener());

      add(jDialogButton);
      add(jOptionPaneButton);
      add(inputLine);
   }

   private class TextFieldListener implements ActionListener
   {
      @Override
      public void actionPerformed(ActionEvent arg0)
      {
         String s = inputLine.getText();
         String sUp = s.toUpperCase();
         inputLine.setText(sUp);
      }
   }

   private class JDialogButtonListener implements ActionListener
   {
      @Override
      public void actionPerformed(ActionEvent arg0)
      {
         
         new InputDialog("JDialog with problem");
      }
   }

   private class JOptionPaneButtonListener implements ActionListener
   {
      @Override
      public void actionPerformed(ActionEvent arg0)
      {
         JOptionPane.showInputDialog("JOptionPane with the problem");
      }
   }

   private class InputDialog extends JDialog
   {
      private JPanel mainPanel = new JPanel();

      InputDialog(String title)
      {
         super((Frame) null, title, true);
         initUI();
      }

      private void initUI()
      {
         JTextField textField = new JTextField();
         textField.addActionListener(new TextFieldListener());

         JPanel panel = new JPanel(new BorderLayout());
         panel.add(textField, BorderLayout.CENTER);

         setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);

         getContentPane().setLayout(new BorderLayout());
         Border mainPanelBorder = BorderFactory.createEmptyBorder(5, 5, 0, 5);
         mainPanel.setBorder(mainPanelBorder);
         mainPanel.setLayout(new BorderLayout());
         mainPanel.add(panel, BorderLayout.CENTER);

         getContentPane().add(mainPanel, BorderLayout.CENTER);

         pack();
         setVisible(true);
      }
   }
}
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Copy the characters from a externa source and than use paste. Works but not sustainable


Comments
In one of the duplicate issues (JI-9012142), user reported: "Entry of certain characters and using IME's in JTextField's do not work in Java 7u55 nor Java 8u5 anymore. Both these functionalities previously worked in Java 7u51 and Java 8 and earlier.". Due to this, escape-CPU/PSU14_02ext label is added.
07-04-2015

SQE OK to take the fix into CPU15_01.
13-08-2014

The characters mentioned in the bug description: "������".
28-04-2014