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

On using JTextArea with SwingNode, IME's on-the-spot does not work fine

XMLWordPrintable

    • x86_64
    • windows

      FULL PRODUCT VERSION :
      Java(TM) SE Runtime Environment (build 9-ea+174)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+174, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Japanese Environment

      A DESCRIPTION OF THE PROBLEM :
      When I input Japanese Text with IME to JTextArea on SwingNode, a small input window is shown like JDK-8090267.
      So, on-the-spot does not work with Swing component embedded on SwingNode.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Execute the attached sample code
      2. Input text with IME on


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The on-the-spot behavior.
      ACTUAL -
      The root-window behavior.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public class SwingNodeTest extends Application {

          public static void main(String[] args) {
              Application.launch(args);
          }

          @Override
          public void start(Stage primaryStage) {
              primaryStage.setTitle("TextArea Test");
              Group root = new Group();
              Scene scene = new Scene(root, 600, 330, Color.WHITE);

              SwingNode swingNode = new SwingNode();
              root.getChildren().add(swingNode);

              final JTextArea jTextArea = new JTextArea();
              try {
                  SwingUtilities.invokeAndWait(() -> {
                      jTextArea.setLineWrap(true);
                      jTextArea.setColumns(10);
                      jTextArea.setRows(10);
                  });
              } catch (InterruptedException | InvocationTargetException ex) {
                  ex.printStackTrace();
              }
              
              swingNode.setContent(jTextArea);
              primaryStage.setScene(scene);
              primaryStage.show();
          }
      ---------- END SOURCE ----------

            psadhukhan Prasanta Sadhukhan
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: