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

[macosx] Language specific keys does not work in applets when opened outside the browser

    Details

    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      x86
    • OS:
      os_x

      Backports

        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

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  pchelko Petr Pchelko (Inactive)
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: