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

Focus does not transfer back to initial component

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_xp

      Description

      This is reproducible with jdk7 b27 PIT build on Windows XP Professional. Not reproducible with 6u10 b23.

      In the below test, in addition to a button, I've a panel which is the focus traversal policy provider with ContainerOrderFocusTraversalPolicy as the focus traversal policy. Initially, the button has focus. On pressing tab, the panel gains focus, but focus does not reach back the button on pressing tab again.

      import java.awt.*;

      public class FocusTraversalTest {
          public static void main(String[] args) {
              
              Frame f = new Frame();
              f.setSize(300, 300);
              
              f.setLayout(new FlowLayout());
              Button b = new Button("North");
              f.add(b, BorderLayout.NORTH);
              
              Panel p = new Panel();
              p.setFocusTraversalPolicyProvider(true);
              p.setFocusTraversalPolicy(new ContainerOrderFocusTraversalPolicy());
              p.add(new Button("B1"));
              p.add(new Button("B2"));
              
              f.add(p);
              f.setVisible(true);
          }
      }

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ant Anton Tarasov
                Reporter:
                gramachasunw Girish Ramachandran (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: