Package javax.swing

Examples of javax.swing.JComboBox.removeItem()


    JComboBox c1 = new JComboBox();
    harness.check(c1.getSelectedIndex(), -1);
    harness.check(c1.getSelectedItem(), null);
   
    // remove an item when it doesn't exist
    c1.removeItem("Item 1");
    harness.check(c1.getSelectedIndex(), -1);
    harness.check(c1.getSelectedItem(), null);
   
    c1.addItem("Item 1");
    harness.check(c1.getSelectedItem(), "Item 1");
View Full Code Here


    harness.check(c1.getSelectedItem(), "Item 1");
    c1.addItem("Item 3");
    harness.check(c1.getSelectedItem(), "Item 1");
    c1.setSelectedItem("Item 3");
    harness.check(c1.getSelectedItem(), "Item 3");
    c1.removeItem("Item 3");
    harness.check(c1.getSelectedItem(), "Item 2");

    // check null
    c1.removeItem(null);
    harness.check(c1.getSelectedItem(), "Item 2");
View Full Code Here

    harness.check(c1.getSelectedItem(), "Item 3");
    c1.removeItem("Item 3");
    harness.check(c1.getSelectedItem(), "Item 2");

    // check null
    c1.removeItem(null);
    harness.check(c1.getSelectedItem(), "Item 2");

    c1.removeItem("Item 2");
    harness.check(c1.getSelectedItem(), "Item 1");
    harness.check(c1.getSelectedIndex(), 0);
View Full Code Here

    // check null
    c1.removeItem(null);
    harness.check(c1.getSelectedItem(), "Item 2");

    c1.removeItem("Item 2");
    harness.check(c1.getSelectedItem(), "Item 1");
    harness.check(c1.getSelectedIndex(), 0);
   
    c1.addItem("Item A");
    c1.removeItem("Item 1");
View Full Code Here

    c1.removeItem("Item 2");
    harness.check(c1.getSelectedItem(), "Item 1");
    harness.check(c1.getSelectedIndex(), 0);
   
    c1.addItem("Item A");
    c1.removeItem("Item 1");
    harness.check(c1.getSelectedItem(), "Item A");
    harness.check(c1.getSelectedIndex(), 0);
  }
 
}
View Full Code Here

        JComboBox combo = new JComboBox(new TestModel2());

        combo.insertItemAt("TESTVALUE", 5);
        harness.check(combo.getItemAt(5), "TESTVALUE", "insertItemAt");

        combo.removeItem("TESTVALUE");
        harness.check(combo.getItemCount(), 10, "removeItem");
       
        combo.removeItemAt(0);
        harness.check(combo.getItemCount(), 9, "removeItemAt");
       
View Full Code Here

        harness.check(ok, "insertItemAt");

        ok = false;
        try
        {
            combo.removeItem("BOGUS");
        }
        catch (RuntimeException re)
        {
            ok = true;
        }
View Full Code Here

        String[] types = TypesMapping.getDatabaseTypes();
        JComboBox comboBox = Application.getWidgetFactory().createComboBox(types, true);

        // Types.NULL makes no sense as a column type
        comboBox.removeItem("NULL");

        AutoCompletion.enable(comboBox);

        col.setCellEditor(Application.getWidgetFactory().createCellEditor(comboBox));
View Full Code Here

        String[] types = TypesMapping.getDatabaseTypes();
        JComboBox comboBox = CayenneWidgetFactory.createComboBox(types, true);
       
        // Types.NULL makes no sense as a column type
        comboBox.removeItem("NULL");
       
        AutoCompletion.enable(comboBox);
       
        col.setCellEditor(CayenneWidgetFactory.createCellEditor(comboBox));
View Full Code Here

        String[] types = TypesMapping.getDatabaseTypes();
        JComboBox comboBox = Application.getWidgetFactory().createComboBox(types, true);

        // Types.NULL makes no sense as a column type
        comboBox.removeItem("NULL");

        AutoCompletion.enable(comboBox);

        col.setCellEditor(Application.getWidgetFactory().createCellEditor(comboBox));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.