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

[win] IME candidate window wrong position

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 9, 10
    • Fix Version/s: None
    • Component/s: client-libs
    • Labels:
      None

      Description

      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);
        }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ant Anton Tarasov
                Reporter:
                ant Anton Tarasov
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: