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

[win] IME candidate window wrong position

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 9, 10
    • client-libs
    • None

      IME candidate window is positioned incorrectly on HiDPI display.

      To reproduce:
      - Add (e.g.) Japanese locale, switch to IME mode.
      - Run the testcase below on a display with a scale factor > 1, or scale it manually -Dsun.java2d.uiScale=<scale>.
      - Type into a) frame b) window

      The IME window appears in a) unscaled coordinates, b) relative to the frame, not window.

      ----------------------------
      import javax.swing.*;
      import java.awt.*;

      public class scratch_7 {
        public static void main(String[] args) {
          EventQueue.invokeLater(scratch_7::run);
        }

        static void run() {
          JFrame frame = new JFrame("owner");
          JTextField text1 = new JTextField("type some hiragana here");
          frame.add(text1);
          frame.pack();
          frame.setLocation(200, 200);
          frame.setVisible(true);

          JWindow window = new JWindow(frame);
          JTextField text2 = new JTextField("type some hiragana here");
          window.add(text2);
          window.pack();
          window.setLocationRelativeTo(null);
          window.setVisible(true);
        }
      }

            ant Anton Tarasov (Inactive)
            ant Anton Tarasov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: