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

[macosx] We can not input Japanese in JFXPanel

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3
    • None
    • 7u45, 8, 9
    • javafx
    • os_x

    Description

      FULL PRODUCT VERSION :
      java version "1.7.0_45"
      Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
      Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      MacOsX 10.9

      A DESCRIPTION OF THE PROBLEM :
      We can not input Japanese to a TextField in a JFXPanel. When we try to input Japanese, alphabets are shown in the field(not Japanese) on 1.7.0. If we use Java8ea, nothing is shown and NPE when we try to translate the word.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Run the attached program.
      2. Try to input Japanese to the TextField

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Japanese characters are shown in the TextField and we can translate words in the field.
      ACTUAL -
      (Java7) Only alphabets are shown in the TextField.
      (Java8) Nothing is shown and NPE

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      (Java7)
      2013-11-14 18:42:46.787 java[20527:507] An uncaught exception was raised
      2013-11-14 18:42:46.804 java[20527:507] java.lang.NullPointerException
      2013-11-14 18:42:46.839 java[20527:507] (
      0 CoreFoundation 0x00007fff8d98e41c __exceptionPreprocess + 172
      1 libobjc.A.dylib 0x00007fff8867ce75 objc_exception_throw + 43
      2 CoreFoundation 0x00007fff8d98dfc9 -[NSException raise] + 9
      3 JavaNativeFoundation 0x000000010b371457 JNFCallObjectMethod + 212
      4 liblwawt.dylib 0x000000010bc93913 -[AWTView attributedSubstringForProposedRange:actualRange:] + 78
      5 AppKit 0x00007fff868e481d -[NSTextInputContext handleTSMEvent:] + 3476
      6 AppKit 0x00007fff868e3a65 _NSTSMEventHandler + 205
      7 HIToolbox 0x00007fff87c166d4 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 892
      8 HIToolbox 0x00007fff87c15c87 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 385
      9 HIToolbox 0x00007fff87c29d90 SendEventToEventTarget + 40
      10 HIToolbox 0x00007fff87c6b0ed SendTSMEvent + 33
      11 HIToolbox 0x00007fff87e1871f SendTextInputEvent + 1028
      12 HIToolbox 0x00007fff87e638ec -[IMKInputSession _copyUniCharsForRange:intoBuffer:ofLength:] + 268
      13 HIToolbox 0x00007fff87e639bb -[IMKInputSession _coreAttributesFromRange:whichAttributes:actualRange:] + 137
      14 HIToolbox 0x00007fff87e64aac -[IMKInputSession attributedSubstringFromRange:] + 89
      15 CoreFoundation 0x00007fff8d879dec __invoking___ + 140
      16 CoreFoundation 0x00007fff8d879c54 -[NSInvocation invoke] + 308
      17 CoreFoundation 0x00007fff8d91c7a6 -[NSInvocation invokeWithTarget:] + 54
      18 CoreFoundation 0x00007fff8d8ec384 ___forwarding___ + 452
      19 CoreFoundation 0x00007fff8d8ec138 _CF_forwarding_prep_0 + 120
      20 CoreFoundation 0x00007fff8d879dec __invoking___ + 140
      21 CoreFoundation 0x00007fff8d879c54 -[NSInvocation invoke] + 308
      22 Foundation 0x00007fff8ab79c67 -[NSConnection dispatchInvocation:] + 135
      23 Foundation 0x00007fff8ab7992d -[NSConnection handleRequest:sequence:] + 1434
      24 Foundation 0x00007fff8ab20cf0 -[NSConnection handlePortCoder:] + 652
      25 Foundation 0x00007fff8ab20628 -[NSConnection dispatchWithComponents:] + 50
      26 Foundation 0x00007fff8ab04ed8 __NSFireMachPort + 257
      27 CoreFoundation 0x00007fff8d8bfd04 __CFMachPortPerform + 388
      28 CoreFoundation 0x00007fff8d8bfb69 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41
      29 CoreFoundation 0x00007fff8d8bfade __CFRunLoopDoSource1 + 478
      30 CoreFoundation 0x00007fff8d8b0bd6 __CFRunLoopRun + 1830
      31 CoreFoundation 0x00007fff8d8b0275 CFRunLoopRunSpecific + 309
      32 Foundation 0x00007fff8ab1d00e -[NSConnection sendInvocation:internal:] + 1965
      33 CoreFoundation 0x00007fff8d8ec384 ___forwarding___ + 452
      34 CoreFoundation 0x00007fff8d8ec138 _CF_forwarding_prep_0 + 120
      35 HIToolbox 0x00007fff87e5fb8d -[IMKInputSession handleEvent:] + 946
      36 HIToolbox 0x00007fff87e232e8 IMKInputSessionProcessEventRef + 45
      37 HIToolbox 0x00007fff87e228aa InputMethodInstanceProcessEventRef + 100
      38 HIToolbox 0x00007fff87e17e6f TSMEventToInputMethod + 131
      39 HIToolbox 0x00007fff87c6a87c TSMKeyEvent + 283
      40 HIToolbox 0x00007fff87c57678 TSMProcessRawKeyEvent + 3584
      41 AppKit 0x00007fff868e32b0 -[NSTextInputContext handleEvent:] + 731
      42 AppKit 0x00007fff868c2b5d -[NSView interpretKeyEvents:] + 180
      43 liblwawt.dylib 0x000000010bc92880 -[AWTView keyDown:] + 85
      44 AppKit 0x00007fff8688f81b -[NSWindow sendEvent:] + 1843
      45 liblwawt.dylib 0x000000010bc962f5 -[AWTWindow_Normal sendEvent:] + 86
      46 AppKit 0x00007fff86830ca2 -[NSApplication sendEvent:] + 3395
      47 libosxapp.dylib 0x000000010bd2e66f -[NSApplicationAWT sendEvent:] + 179
      48 AppKit 0x00007fff86680a29 -[NSApplication run] + 646
      49 libosxapp.dylib 0x000000010bd2e557 +[NSApplicationAWT runAWTLoopWithApp:] + 156
      50 liblwawt.dylib 0x000000010bc86ba9 -[AWTStarter starter:] + 873
      51 Foundation 0x00007fff8aafe0de __NSThreadPerformPerform + 229
      52 CoreFoundation 0x00007fff8d8bf8f1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
      53 CoreFoundation 0x00007fff8d8b1062 __CFRunLoopDoSources0 + 242
      54 CoreFoundation 0x00007fff8d8b07ef __CFRunLoopRun + 831
      55 CoreFoundation 0x00007fff8d8b0275 CFRunLoopRunSpecific + 309
      56 java 0x0000000102b9e3b0 CreateExecutionEnvironment + 871
      57 java 0x0000000102b98b5c JLI_Launch + 1952
      58 java 0x0000000102b9e70d main + 101
      59 java 0x0000000102b983b4 start + 52
      60 ??? 0x0000000000000004 0x0 + 4
      )

      (Java8)
      Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
      at javafx.embed.swing.JFXPanel.sendInputMethodEventToFX(JFXPanel.java:615)
      at javafx.embed.swing.JFXPanel.processInputMethodEvent(JFXPanel.java:603)
      at java.awt.Component.processEvent(Component.java:6311)
      at java.awt.Container.processEvent(Container.java:2235)
      at java.awt.Component.dispatchEventImpl(Component.java:4885)
      at java.awt.Container.dispatchEventImpl(Container.java:2293)
      at java.awt.Component.dispatchEvent(Component.java:4707)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:746)
      at java.awt.EventQueue.access$400(EventQueue.java:97)
      at java.awt.EventQueue$3.run(EventQueue.java:697)
      at java.awt.EventQueue$3.run(EventQueue.java:691)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
      at java.awt.EventQueue$4.run(EventQueue.java:719)
      at java.awt.EventQueue$4.run(EventQueue.java:717)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:716)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:220)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:135)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:123)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:119)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:111)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:97)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JFrame;
      import javafx.application.Platform;
      import javafx.embed.swing.JFXPanel;
      import javafx.scene.Group;
      import javafx.scene.Scene;
      import javafx.scene.media.Media;
      import javafx.scene.media.MediaPlayer;
      import javafx.scene.media.MediaView;
      import javafx.scene.layout.HBox;
      import javax.swing.JFrame;
      import javax.swing.SwingUtilities;
      import javafx.scene.control.TextField;

      public class JavaSwingTest extends JFrame{
           public void buildGUI(){
                final JFXPanel panel = new JFXPanel();
                Platform.runLater(new Runnable() {
                       public void run() {
                            HBox box = new HBox();
                            Scene sc= new Scene(box);
                            TextField field = new TextField();
                            field.setPromptText("this is prompt");
                            box.getChildren().add(field);
                            panel.setScene(sc);
                       }
                   });
                getContentPane().add(panel);
                setVisible(true);
                setSize(200,200);
           }
           
           public static void main(String[] args){
                JavaSwingTest t = new JavaSwingTest();
                t.buildGUI();
           }
      }
      ---------- END SOURCE ----------

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: