Package java.awt.event

Examples of java.awt.event.ItemEvent


        choice.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent ie) {
                eventProcessed = true;
            }
        });
        choice.processEvent(new ItemEvent(choice, ItemEvent.ITEM_STATE_CHANGED,
                                          null, ItemEvent.DESELECTED));
        assertTrue(eventProcessed);
    }
View Full Code Here


        checkbox.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent ie) {
                eventProcessed = true;
            }
        });
        checkbox.processEvent(new ItemEvent(checkbox,
                                              ItemEvent.ITEM_STATE_CHANGED,
                                              checkbox, ItemEvent.SELECTED));
        assertTrue(eventProcessed);
    }
View Full Code Here

    if (isFired) {
      return;
    } else {
      isFired = true;
      setSelectedItem(obj);
      fireItemStateChanged(new ItemEvent(this, 701, selectedItemReminder,
          1));
      isFired = false;
      return;
    }
  }
View Full Code Here

    c.addItemListener(this);
   
    c.setSelectedIndex(1);
    harness.check(c.getSelectedItem(), "B");
    harness.check(events.size(), 2);
    ItemEvent e1 = (ItemEvent) events.get(0);
    harness.check(e1.getStateChange(), ItemEvent.DESELECTED);
    harness.check(e1.getItem(), "A");
    ItemEvent e2 = (ItemEvent) events.get(1);
    harness.check(e2.getStateChange(), ItemEvent.SELECTED);
    harness.check(e2.getItem(), "B");
    events.clear();
   
    c.setSelectedIndex(-1);
    harness.check(events.size(), 1);
    e1 = (ItemEvent) events.get(0);
View Full Code Here

    private void searchFor(String search) {
        for (int i = 0; i < m_mechsCurrent.length; i++) {
            if (m_mechsCurrent[i].getName().toLowerCase().startsWith(search)) {
                m_mechList.select(i);
                ItemEvent event = new ItemEvent(m_mechList,
                        ItemEvent.ITEM_STATE_CHANGED, m_mechList,
                        ItemEvent.SELECTED);
                itemStateChanged(event);
                break;
            }
View Full Code Here

    private void searchFor(String search) {
        for (int i = 0; i < m_mechsCurrent.length; i++) {
            if (m_mechsCurrent[i].getName().toLowerCase().startsWith(search)) {
                m_mechList.select(i);
                ItemEvent event = new ItemEvent(m_mechList,
                        ItemEvent.ITEM_STATE_CHANGED, m_mechList,
                        ItemEvent.SELECTED);
                itemStateChanged(event);
                break;
            }
View Full Code Here

        // Refill the item list when a new category is selected.
        // Make sure that the "select new camo" button is updated.
        categories.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent event) {
                fillList((String) event.getItem());
                CamoChoiceDialog.this.itemStateChanged(new ItemEvent(items,
                        event.getID(), items.getSelectedItem(),
                        ItemEvent.SELECTED));
            }
        });
View Full Code Here

                Image[] array = (Image[]) this.getSelectedObjects();
                if (null != array)
                    image = array[0];

                // Create an ItemEvent for the change.
                ItemEvent alert = new ItemEvent(this, event.getID(), image,
                        ItemEvent.ITEM_STATE_CHANGED);

                // Alert the listeners.
                for (ItemListener l : listeners) {
                    l.itemStateChanged(alert);
View Full Code Here

            // Make sure the "keep" button is set correctly.
            setPrevSelection(categories.getSelectedItem(), items
                    .getSelectedItem());

            // Make sure the "select" button is set correctly.
            itemStateChanged(new ItemEvent(items, 0, items.getSelectedItem(),
                    ItemEvent.SELECTED));

            // Now show the dialog.
        }
        super.setVisible(show);
View Full Code Here

                if (array != null) {
                    image = array[0];
                }

                // Create an ItemEvent for the change.
                ItemEvent alert = new ItemEvent(this, event.getID(), image,
                        ItemEvent.ITEM_STATE_CHANGED);

                // Alert the listeners.
                Enumeration<ItemListener> alerts = listeners.elements();
                while (alerts.hasMoreElements()) {
View Full Code Here

TOP

Related Classes of java.awt.event.ItemEvent

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.