Java 类java.awt.ContainerOrderFocusTraversalPolicy 实例源码

项目:openjdk-jdk10    文件:ContainerOrderFTPTest.java   
public ContainerOrderFTPTest() {
    expectedTraversal = "B1B2F1";
    b1 = new Button("B1");
    b2 = new Button("B2");
    frame = new Frame("F1");

    frame.setLayout(new FlowLayout());
    frame.setSize(200, 200);
    coftp = new ContainerOrderFocusTraversalPolicy();
    frame.setFocusTraversalPolicy(coftp);
    frame.add(b1);
    frame.add(b2);
    frame.setVisible(true);
}
项目:openjdk9    文件:ContainerOrderFTPTest.java   
public ContainerOrderFTPTest() {
    expectedTraversal = "B1B2F1";
    b1 = new Button("B1");
    b2 = new Button("B2");
    frame = new Frame("F1");

    frame.setLayout(new FlowLayout());
    frame.setSize(200, 200);
    coftp = new ContainerOrderFocusTraversalPolicy();
    frame.setFocusTraversalPolicy(coftp);
    frame.add(b1);
    frame.add(b2);
    frame.setVisible(true);
}
项目:swing-jgoodies-forms    文件:FormBuilderTest.java   
@Test
public void customFocusTraversalPolicy() {
    FormBuilder.create()
        .columns("pref")
        .rows("pref")
        .focusTraversalPolicy(new ContainerOrderFocusTraversalPolicy())
        .build();
}
项目:swing-jgoodies-forms    文件:FormBuilderTest.java   
@Test(expected=IllegalStateException.class)
public void rejectSettingFocusTraversalPolicyTwice() {
    FormBuilder.create()
        .columns("pref")
        .rows("pref")
        .focusTraversalPolicy(new ContainerOrderFocusTraversalPolicy())
        .focusTraversalPolicy(new LayoutFocusTraversalPolicy())
        .build();
}