Package java.awt

Examples of java.awt.List$AccessibleAWTList$AccessibleAWTListChild


   */
  public void test(TestHarness harness)
  {
    setBackground(Color.red);
    Frame f = new Frame();
    List c = new List(2);
    c.add("1");
    c.add("2");
    c.add("3");
    add(c);
    f.add(this);
    f.pack();
    f.show();
    Rectangle bounds = c.getBounds();
    Insets i = f.getInsets();
    Point loc = f.getLocationOnScreen();
    loc.x += i.left + bounds.x;
    loc.y += i.top + bounds.y;
    bounds.x += i.left;
View Full Code Here


    //   w += (num + 1) * hgap + ins.left + ins.right;
    // when there is one or more components in container.
    container.add(new Button());
    harness.check(layout.minimumLayoutSize(container), new Dimension(10, 10));
    container.add(new Button());
    container.add(new List());
    harness.check(layout.minimumLayoutSize(container), new Dimension(20, 10));
  }
View Full Code Here

    test3(harness);
  }
 
  public void test1(TestHarness harness)
  {
    List list = new List();
    list.setMultipleMode(true);
    harness.check(list.isMultipleMode());
    list.add("item");
    list.add("item1");
    list.select(1);
    list.select(0);
    Frame f = new Frame("");
    f.add(list);
    f.pack();
    harness.check(list.getSelectedIndex(), -1);
    list.setMultipleMode(false);
    harness.check(list.getSelectedIndex(), 0);
    harness.check(list.isMultipleMode(), false);
    harness.check(list.getSelectedIndex(), 0);
    f.dispose();
  }
View Full Code Here

    f.dispose();
  }
 
  public void test2(TestHarness harness)
  {
    List list = new List();
    list.setMultipleMode(true);
    harness.check(list.isMultipleMode());
    list.add("item1");
    list.add("item2");
    list.add("item3");
    harness.check(list.getItemCount(), 3);
    list.select(1);
    list.select(0);
    list.select(2);
    harness.check(list.isSelected(0));
    harness.check(list.isSelected(1));
    harness.check(list.isSelected(2));
    list.setMultipleMode(false);
    harness.check(list.isMultipleMode(), false);
    harness.check(list.getItemCount(), 3);
    harness.check(list.getSelectedIndex(), -1);
    harness.check(list.isSelected(0));
    harness.check(list.isSelected(1), true);
    harness.check(list.isSelected(2), true);
  }
View Full Code Here

    harness.check(list.isSelected(2), true);
  }

  public void test3(TestHarness harness)
  {
    List list = new List();
    list.add("item1");
    list.add("item2");
    list.add("item3");
    harness.check(list.isMultipleMode(), false);
    list.select(2);
    list.select(0);
    list.select(1);
    harness.check(list.isSelected(0), false);
    harness.check(list.isSelected(1), true);
    harness.check(list.isSelected(2), false);
    list.setMultipleMode(true);
    harness.check(list.isSelected(0), false);
    harness.check(list.isSelected(1), true);
    harness.check(list.isSelected(2), false);
  }
View Full Code Here

   * @param harness the test harness to use
   */
  public void test(TestHarness harness)
  {
    Frame f = new Frame();
    List l = new List(10);
    TextArea t = new TextArea(10, 10);
    f.setSize(300, 300);
    t.setBounds(10, 10, 100, 100);
    l.setBounds(0, 0, 100, 100);
   
    t.setVisible(true);
    l.setVisible(false);
    f.add(l);
    f.add(t);
    f.show();
   
    Robot r = harness.createRobot();
    r.waitForIdle();
    r.delay(1000);
   
    Point po = l.getLocation();
    harness.check(t.isVisible(), true);
    harness.check(f.isVisible(), true);
    harness.check(l.isVisible(), false);
    harness.check(f.getComponentAt(po.x, po.y) == l);
  }
View Full Code Here

  public void test1(TestHarness harness)
  {
    // Testing that only one item can be selected when
    // multipleMode is set to false.
    list = new List();
    harness.check (list.getSelectedIndex() == -1);
    list.setMultipleMode(false);
    list.add("item1");
    list.add("item2");
    list.select(0);
View Full Code Here

  public void test2(TestHarness harness)
  {
    // Testing that more than one item can be selected when
    // multipleMode is set to true.
    list = new List();
    list.setMultipleMode(true);
    list.add("item1");
    list.add("item2");
    list.select(0);
    list.select(1);
View Full Code Here

  public void test3(TestHarness harness)
  {
    // Testing that only one item can be selected when
    // multipleMode is set to false, regardless of the order
    // that the selection is made.
    list = new List();
    list.setMultipleMode(false);
    list.add("item1");
    list.add("item2");
    list.add("item3");
    list.select(0);
View Full Code Here

  public void test4(TestHarness harness)
  {
    // Testing that more than one item can be selected when
    // multipleMode is set to true, regardless of the order
    // that the selection is made.
    list = new List();
    list.setMultipleMode(true);
    list.add("item1");
    list.add("item2");
    list.add("item3");
    list.select(0);
View Full Code Here

TOP

Related Classes of java.awt.List$AccessibleAWTList$AccessibleAWTListChild

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.