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

Cannot enter container with isFocusCycleRoot==true using

XMLWordPrintable

    • generic
    • generic



      Name: keR10081 Date: 11/03/2000


      Run testcase, press SHIFT-TAB repeatedly. You wouldn't be able to reach
      buttons
      in the inner panel with isFocusCycleRoot==true using SHIFT-TAB. Although
      you can
      reach these buttons using TAB.

      Testcase:

      import java.applet.*;
      import java.awt.*;
      import java.awt.event.*;
       
      public class bug4214363awt extends Applet{
              public void init(){
                      setLayout(new GridBagLayout());
                      GridBagConstraints constraints = new
      GridBagConstraints();
                      constraints.weightx = 1.0;
                      constraints.weighty = 1.0;
                      constraints.gridwidth = 1;
                      constraints.gridheight = 1;
                      constraints.fill = GridBagConstraints.BOTH;
                      constraints.gridy=0;
                      for (int i=0; i<3; i++) {
                              Button button = new Button("" + i);
                              constraints.gridx=i;
                              add(button, constraints);
                      }
                      Panel panel = new FocusCycleConstrainedPanel();
                      panel.setLayout(new GridLayout(1,3));
                      for (int i=0; i<3; i++) {
                              Button button = new Button("" + (i+3));
                              panel.add(button);
                      }
                      constraints.gridx=0;
                      constraints.gridy=1;
                      constraints.gridwidth=3;
                      add(panel, constraints);
                      constraints.gridy=2;
                      constraints.gridwidth=1;
                      for (int i=0; i<3; i++) {
                              Button button = new Button("" + (i+6));
                              constraints.gridx=i;
                              add(button, constraints);
                      }
                      setSize(300, 200);
              }

              public static void main(String args[]){
                      bug4214363awt b=new bug4214363awt();
                      b.init();
              }
      }
      class FocusCycleConstrainedPanel extends Panel {
        public boolean isFocusCycleRoot() {
          return true;
        }
      }

      ======================================================================

            son Oleg Sukhodolsky (Inactive)
            kereminsunw Konstantin Eremin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: