KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > ComboBoxModel


1 /*
2  * @(#)ComboBoxModel.java 1.15 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7 package javax.swing;
8
9 /**
10  * A data model for a combo box. This interface extends <code>ListDataModel</code>
11  * and adds the concept of a <i>selected item</i>. The selected item is generally
12  * the item which is visible in the combo box display area.
13  * <p>
14  * The selected item may not necessarily be managed by the underlying
15  * <code>ListModel</code>. This disjoint behavior allows for the temporary
16  * storage and retrieval of a selected item in the model.
17  *
18  * @version 1.15 12/19/03
19  * @author Arnaud Weber
20  */

21 public interface ComboBoxModel extends ListModel JavaDoc {
22
23   /**
24    * Set the selected item. The implementation of this method should notify
25    * all registered <code>ListDataListener</code>s that the contents
26    * have changed.
27    *
28    * @param anItem the list object to select or <code>null</code>
29    * to clear the selection
30    */

31   void setSelectedItem(Object JavaDoc anItem);
32
33   /**
34    * Returns the selected item
35    * @return The selected item or <code>null</code> if there is no selection
36    */

37   Object JavaDoc getSelectedItem();
38 }
39
40
Popular Tags