Examples of addListDataListener()


Examples of charvax.swing.DefaultListModel.addListDataListener()

            for (int i = 0; i < vehicles.length; i++) {
                model.addElement(vehicles[ i]);
                if (vehicles[ i].length() > columns)
                        columns = vehicles[ i].length();
            }
            model.addListDataListener(this);

            _vehicleList = new JList(model);
            _vehicleList.setVisibleRowCount(5);
            _vehicleList.setColumns(columns);
            _vehicleList.addListSelectionListener(this);
View Full Code Here

Examples of javax.swing.ComboBoxModel.addListDataListener()

    private JMenu _makeTransmitSelectedRowsMenu() {
        final JMenu menu = new JMenu("Transmit Selected Rows to");
        _tableSelectionSendManager = new SendManager(_connector, "table.select.rowList");
        final ComboBoxModel comboBoxModel = _tableSelectionSendManager.getComboBoxModel();
        // monitor changes in the ComboBoxModel to keep the menu up to date
        comboBoxModel.addListDataListener(new ListDataListener() {
            @Override
            public void intervalAdded(ListDataEvent e) {
            }

            @Override
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

  private ComboBoxModel createUnitModel()
  {
    final DefaultComboBoxModel model = new DefaultComboBoxModel(Unit.values());
    model.setSelectedItem(Unit.POINTS);
    model.addListDataListener(new UnitChangeListener());
    return model;
  }

  protected String getDialogId()
  {
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

  private ComboBoxModel createUnitModel()
  {
    final DefaultComboBoxModel model = new DefaultComboBoxModel(Unit.values());
    model.setSelectedItem(Unit.POINTS);
    model.addListDataListener(new UnitChangeListener());
    return model;
  }

  protected ComboBoxModel getUnitModel()
  {
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel();
    m.addListDataListener(this);
   
    m.insertElementAt("A", 0);
    harness.check(m.getSize(), 1);
    harness.check(m.getElementAt(0), "A");
    harness.check(m.getSelectedItem(), null);
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    m.removeElement("A");
    harness.check(m.getSize(), 2);
    harness.check(m.getElementAt(0), "B");
    harness.check(m.getSelectedItem(), "B");
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel();
    m.addListDataListener(this);
   
    m.addElement("A");
    harness.check(m.getSize(), 1);
    harness.check(m.getElementAt(0), "A");
    harness.check(m.getSelectedItem(), "A");
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    harness.check(m.getSize(), 3);
    harness.check(m.getSelectedItem(), "A");
   
    m.removeAllElements();
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B",
            "C"});
    harness.check(m.getSelectedItem(), "A");
   
    m.addListDataListener(this);

    // first set the selected item to one of the elements in the list...
    m.setSelectedItem("C");
    harness.check(events.size(), 1);
    harness.check(m.getSelectedItem(), "C");
View Full Code Here

Examples of javax.swing.DefaultComboBoxModel.addListDataListener()

   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {  
    DefaultComboBoxModel m = new DefaultComboBoxModel(new Object[] {"A", "B", "C"});
    m.addListDataListener(this);
   
    m.removeElementAt(0);
    harness.check(m.getSize(), 2);
    harness.check(m.getElementAt(0), "B");
    harness.check(m.getSelectedItem(), "B");
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.