|
Java example source code file (ItemEvent.java)
The ItemEvent.java Java example source code/* * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package java.awt.event; import java.awt.AWTEvent; import java.awt.ItemSelectable; /** * A semantic event which indicates that an item was selected or deselected. * This high-level event is generated by an ItemSelectable object (such as a * List) when an item is selected or deselected by the user. * The event is passed to every <code>ItemListener object which * registered to receive such events using the component's * <code>addItemListener method. * <P> * The object that implements the <code>ItemListener interface gets * this <code>ItemEvent when the event occurs. The listener is * spared the details of processing individual mouse movements and mouse * clicks, and can instead process a "meaningful" (semantic) event like * "item selected" or "item deselected". * <p> * An unspecified behavior will be caused if the {@code id} parameter * of any particular {@code ItemEvent} instance is not * in the range from {@code ITEM_FIRST} to {@code ITEM_LAST}. * <p> * The {@code stateChange} of any {@code ItemEvent} instance takes one of the following * values: * <ul> * <li> {@code ItemEvent.SELECTED} * <li> {@code ItemEvent.DESELECTED} * </ul> * Assigning the value different from listed above will cause an unspecified behavior. * * @author Carl Quinn * * @see java.awt.ItemSelectable * @see ItemListener * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/itemlistener.html">Tutorial: Writing an Item Listener * * @since 1.1 */ public class ItemEvent extends AWTEvent { /** * The first number in the range of ids used for item events. */ public static final int ITEM_FIRST = 701; /** * The last number in the range of ids used for item events. */ public static final int ITEM_LAST = 701; /** * This event id indicates that an item's state changed. */ public static final int ITEM_STATE_CHANGED = ITEM_FIRST; //Event.LIST_SELECT /** * This state-change value indicates that an item was selected. */ public static final int SELECTED = 1; /** * This state-change-value indicates that a selected item was deselected. */ public static final int DESELECTED = 2; /** * The item whose selection state has changed. * * @serial * @see #getItem() */ Object item; /** * <code>stateChange indicates whether the Other Java examples (source code examples)Here is a short list of links related to this Java ItemEvent.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.