Package java.awt.event

Examples of java.awt.event.ItemEvent


        }
    }

    protected void selectedItemChanged() {
        if (selectedItemReminder != null) {
            ItemEvent itemEvent = new ItemEvent(JComboBox.this, ItemEvent.ITEM_STATE_CHANGED,
                    selectedItemReminder, ItemEvent.DESELECTED);
            fireItemStateChanged(itemEvent);
        }
        Object newSelection = dataModel.getSelectedItem();
        if (isEditable || getIndex(newSelection) != -1) {
            ItemEvent itemEvent = new ItemEvent(JComboBox.this, ItemEvent.ITEM_STATE_CHANGED,
                    newSelection, ItemEvent.SELECTED);
            fireItemStateChanged(itemEvent);
        }
    }
View Full Code Here


    public void setSelected(boolean selected) {
        if (isSelected() != selected) {
            toggleState(SELECTED);
            int state = selected ? ItemEvent.SELECTED : ItemEvent.DESELECTED;
            ItemEvent event = new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, state);
            fireItemStateChanged(event);
        }
    }
View Full Code Here

    }

    private void generateEvent() {
        setState(!getState());
        int stateChange = (checked ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
        postEvent(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, stateChange));
    }
View Full Code Here

            postEvent(new ActionEvent(List.this, ActionEvent.ACTION_PERFORMED,
                    getItem(currentIndex), when, mod));
        }

        public void fireItemEvent(int sel) {
            postEvent(new ItemEvent(List.this, ItemEvent.ITEM_STATE_CHANGED,
                    getItem(currentIndex), sel));
        }
View Full Code Here

        }
    }

    protected void selectedItemChanged() {
        if (selectedItemReminder != null) {
            ItemEvent itemEvent = new ItemEvent(JComboBox.this, ItemEvent.ITEM_STATE_CHANGED,
                    selectedItemReminder, ItemEvent.DESELECTED);
            fireItemStateChanged(itemEvent);
        }
        Object newSelection = dataModel.getSelectedItem();
        if (isEditable || getIndex(newSelection) != -1) {
            ItemEvent itemEvent = new ItemEvent(JComboBox.this, ItemEvent.ITEM_STATE_CHANGED,
                    newSelection, ItemEvent.SELECTED);
            fireItemStateChanged(itemEvent);
        }
    }
View Full Code Here

                    group.setSelected(this, true);
                }
               
                int state = selected ? ItemEvent.SELECTED
                        : ItemEvent.DESELECTED;
                ItemEvent event = new ItemEvent(this,
                        ItemEvent.ITEM_STATE_CHANGED, this, state);
                fireItemStateChanged(event);
               
            } else {
                super.setSelected(selected);
View Full Code Here

            postEvent(new ActionEvent(List.this, ActionEvent.ACTION_PERFORMED,
                    getItem(currentIndex), when, mod));
        }

        public void fireItemEvent(int sel) {
            postEvent(new ItemEvent(List.this, ItemEvent.ITEM_STATE_CHANGED,
                    getItem(currentIndex), sel));
        }
View Full Code Here

    }

    private void generateEvent() {
        setState(!getState());
        int stateChange = (checked ? ItemEvent.SELECTED : ItemEvent.DESELECTED);
        postEvent(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, this, stateChange));
    }
View Full Code Here

        int itemHeight = fm.getHeight() + 2;
        return itemHeight;
    }

    void fireItemEvent() {
        postEvent(new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, getSelectedItem(),
                ItemEvent.SELECTED));
    }
View Full Code Here

    }

    @Override
    AWTEvent createEvent(long when, int modifiers) {
        int state = checked ? ItemEvent.SELECTED : ItemEvent.DESELECTED;
        return new ItemEvent(this, ItemEvent.ITEM_STATE_CHANGED, getLabel(), state);
    }
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.