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

[macosx] Strange focus behavior of JSpinner

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 9
    • 9
    • client-libs

      Run the attached small program on OS X. There is a JTextField as a first component added to the JFrame and a JSpinner with editor configured. Orientation is set to RTL but it doesn't matter, it may be LTR all the same.
      The spinner is someway bigger than necessary: JFrame has fixed height of 300, and layout is GridLayout(2,1).
      Upon start, the focus is naturally on JTextField.
      Now, click on JSpinner once. Depending on a place you are clicking to, the caret will either stay at the start of the date (it's date spinner), as on other platforms, or at the end.
      Namely, click above the text, and caret stay to the left. Click below the text, and caret blinks at the start and jumps to the end.

      Result of the click in the middle is unpredictable. In our semi-automatic test the location is calculated and is always the same but sometimes caret stay to the left and sometimes to the right.

      This behavior in theory may cost a user an extra click and some frustration.

            aniyogi Avik Niyogi (Inactive)
            yan Yuri Nesterenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: