Package java.awt

Examples of java.awt.List$State


  public void test12(TestHarness harness)
  {
    // Testing delItem on two items and when
    // multipleMode is set to true.
    list = new List();
    list.setMultipleMode(true);
    list.add("item1");
    list.add("item2");
    list.add("item3");
    list.select(0);
View Full Code Here


  }

  public void test13(TestHarness harness)
  {
    // Testing delItems when multipleMode is set to false.
    list = new List();
    list.setMultipleMode(false);
    list.add("item1");
    list.add("item2");
    list.add("item3");
    list.select(2);
View Full Code Here

  }

  public void test14(TestHarness harness)
  {
    //Testing delItems when mulitpleMode is set to true.
    list = new List();
    list.setMultipleMode(true);
    list.add("item1");
    list.add("item2");
    list.add("item3");
    list.add("item4");
View Full Code Here

  public void test15(TestHarness harness)
  {
    // Testing behaviour when index passed is invalid.

    // Testing deselect.
    list = new List();
    list.add("item1");
    list.select(0);
    list.deselect(1);
    harness.check(list.isSelected(0), true);
View Full Code Here

  public void test16(TestHarness harness)
  {
    // Testing what happens when a selected item
    // is selected again.
    list = new List();
    list.setMultipleMode(false);
    list.add("item1");
    list.select(0);
    list.select(0);
    harness.check(list.isSelected(0), true);
View Full Code Here

   */
  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

TOP

Related Classes of java.awt.List$State

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.