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

Nimbus: navigation keys incorrect after change of ComponentOrientation

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6u14
    • Fix Version/s: None
    • Component/s: client-libs

      Description

      FULL PRODUCT VERSION :
      java version "1.6.0_14"
      Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
      Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      not relevant

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      not relevant

      A DESCRIPTION OF THE PROBLEM :
      in a JList with multiple column layout, the horizontal navigation keys are not updated of the ComponentOrientation is changed at runtime. This happens in a LToR default context (mine) if the LAF is Nimbus:

      - create and show an arbitrary frame with a list configured to show multiple columns with some control to change the ComponentOrientation
      - navigate horizontally: RIGHT arrow key moves selection the right, that is to the NEXT element in the row, LEFT to the left which is the PREVIOUS element
      - toggle CO to RToL
      - navigate horizontally: RIGHT arrow key still moves to the NEXT which now is left and LEFT still moves to the PREVIOUS which now is right

      all other LAFs keep the direction and remap the semantics: that is in RToL they have RIGHT == PREVIOUS and LEFT == NEXT

      (description is more complicated than the problem <g>)

      Same for JTable

      Don't know if it's regression, maybe never worked for Nimbus, but mark it as such as it's working as expected in the other LAFs. Might be a show-stopper in multi-language contexts which need to toggle CO.

      Cheers
      Jeanette


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      package org.jdesktop.swingx;

      import javax.swing.DefaultComboBoxModel;
      import javax.swing.JList;
      import javax.swing.ListModel;

      /**
       * Issue: Navigation keys not updated on changing ComponentOrientation.
       * This is a test case which uses SwingX testing support. You can easily build
       * your own but then need to implement:
       *
       * - ui to change the component orientation at runtime
       * - not necessarily, but easier to compare behaviour with other LAF: ui to
       * switch between different LAFs
       *
       * @author Jeanette Winzenburg
       */
      public class JListIssues extends InteractiveTestCase {

          public static void main(String[] args) throws Exception {
              JListIssues test = new JListIssues();
              setLookAndFeel("Nimbus");
              try {
                  test.runInteractiveTests();
              } catch (Exception e) {
                  e.printStackTrace();
              }
          }

          public void interactiveMultiColumn() {
              JList core = new JList(createListModel());
              core.setLayoutOrientation(JList.HORIZONTAL_WRAP);
              JXFrame frame = wrapWithScrollingInFrame(core, "Nimbus: navigation keys not updated on CO change");
              addComponentOrientationToggle(frame);
              show(frame);
          }
          protected ListModel createListModel() {
              JList list = new JList();
              return new DefaultComboBoxModel(list.getActionMap().allKeys());
          }

      }

      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              peterz Peter Zhelezniakov (Inactive)
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: