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

Plugin is inoperative with JDialog after Java IM's window is minimized

XMLWordPrintable

      OPERATING SYSTEM(S):
      --------------------
      Solaris Express Developer Edition 9/07 x86 Platform

      FULL JDK VERSION(S):
      -------------------
      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, sharing)

      DESCRIPTION:
      ------------
      Plugin is inoperative with JDialog after Java IM's window is minimized

      Steps to Recreate:

      Please download following jar files
      http://java.sun.com/javase/6/docs/technotes/guides/imf/spi-sample/CityIM.jar
      http://java.sun.com/products/jfc/tsc/articles/InputMethod/InputMethodHotKey.jar
      (http://java.sun.com/products/jfc/tsc/articles/InputMethod/inputmethod.html)

      Test instruction is as follows:
      (Please use Japanese locale)
      1. Copy CityIM.jar to /usr/jdk/packages/lib/ext direcory
      2. Run InputMethodHotKey.jar to set Input Method Hot key, then set Shift+F4 for hot key.
         then close it
         (It's just sample, so you can use another key)
          $ java -jar InputMethodHotKey.jar
      3. Compile test program (CityDialogAppletTest.java)
          $ javac CityDialogAppletTest.java
      4. Run firefox and click "Select City Name" Button, "Select City Name" dialog
          $ firefox $PWD/CityDialogAppletTest.html
      5. Press Shift+F4 to display IM Switch menu
      6. Select "City Input Method" -> "Japanese"
      7. Type "tyo", then "Input Window" is displayed,
      8. "Input Window" has iconify button on its frame, then press it by mouse
      9. "Input Window" and "Select City Name" window are disappeared.
         User cannot display these windows anymore without reloading applet <== PROBLEM

      10. Reload applet by Reload button on Firefox
      11. Click "Select City Name" Button, "Select City Name" dialog
      12. Press Shift+F4 to display IM Switch menu
      13. Select "City Input Method" -> "Japanese"
      14. Type "tyo", then "Input Window" is displayed,
      15. Input Window has iconify button on its frame, then press it by mouse
      16. "Select City Name" dialog is still displayed
      17. Restore "Input Window" and press Space key twice, then "Lookup Window" is displayed
      18. "Lookup Window" has iconify button on its frame, then press it by mouse
      19. "Lookup Window", "Input Window" and "Select City Name" window are disappeared.
          User cannot display these windows anymore without reloading applet <== PROBLEM


      =================================================================
        CityDialogAppletTest.java
      =================================================================
      import java.util.*;
      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class CityDialogAppletTest extends JApplet implements ActionListener {
        final String[] cityNames = new String[]{
          "\u30d5\u30e9\u30f3\u30af\u30d5\u30eb\u30c8", "\u9999\u6e2f", "\u5927\u962a",
          "\u30df\u30e5\u30f3\u30d8\u30f3", "\u30cb\u30e5\u30fc\u30e8\u30fc\u30af",
          "\u30b7\u30ab\u30b4", "\u5317\u4eac", "\u30b5\u30f3\u30d5\u30e9\u30f3\u30b7\u30b9\u30b3",
          "\u4e0a\u6d77", "\u53f0\u5317", "\u6771\u4eac"
        };
        JList cityList = null;
        ArrayList <String> propList = new ArrayList<String>();;
        JLabel lbl = new JLabel(" ");

        void initCityList() {
          if (cityList != null) return;
          for(String cityName : cityNames) propList.add(cityName);
          Collections.shuffle(propList);
          cityList = new JList(propList.toArray());
          cityList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        }

        void shuffleCityList() {
          if (cityList == null) initCityList();
          cityList.clearSelection();
          Collections.shuffle(propList);
          cityList.setListData(propList.toArray());
        }

        public void actionPerformed(ActionEvent ae) {
          shuffleCityList();
          JDialog dialog = new MyJDialogA("Select City Name", true, cityList);
          dialog.setVisible(true);
          Object text = cityList.getSelectedValue();
          if (text != null) lbl.setText(text.toString());
        }

        public void init() {
          Container c = getContentPane();
          JButton btn = new JButton("Select City Name");
          btn.addActionListener(this);
          c.add(lbl, BorderLayout.CENTER);
          c.add(btn, BorderLayout.SOUTH);
        }

        class MyJDialogA extends JDialog implements ActionListener {
          MyJDialogA(String title, boolean modal, Object obj) {
            super();
            setModal(modal);
            setTitle(title);
            Container c = this.getContentPane();
            c.setLayout(new BorderLayout());
            c.add((Component)obj, BorderLayout.CENTER);
            JButton okBtn = new JButton("OK");
            okBtn.addActionListener(this);
            c.add(okBtn, BorderLayout.SOUTH);
            pack();
            setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          }
          public void actionPerformed(ActionEvent ae) {
            setVisible(false);
            dispose();
          }
        }
      }
      =================================================================

      =================================================================
        CityDialogAppletTest.html
      =================================================================
      <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
      <html>
        <head>
          <title></title>
        </head>
                                                                                                                     
        <body>
            <applet code=CityDialogAppletTest width=300 height=200></applet>
        </body>
      </html>
      =================================================================

            nishjain Nishit Jain
            elarsen Erik Larsen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: