Packages  This Package  Prev  Next  Index  
	§3.12 Interface ListPeer
The scrolling list peer interface specifies the methods that all implementations of Abstract 
Window Toolkit scrolling lists must define.
public  interface  java.awt.peer.ListPeer
    extends java.awt.peer.ComponentPeer  (II-§3.6)
{
        // Methods
    public abstract void addItem(String  item, int  index);	§3.12.1
    public abstract void clear();	§3.12.2
    public abstract void delItems(int  start, int  end)	§3.12.3
    public abstract void deselect(int  index);	§3.12.4
    public abstract int[] getSelectedIndexes();	§3.12.5
    public abstract void makeVisible(int  index);	§3.12.6
    public abstract Dimension minimumSize(int  v);	§3.12.7
    public abstract Dimension preferredSize(int  v);	§3.12.8
    public abstract void select(int  index);	§3.12.9
    public abstract void setMultipleSelections(boolean  v);	§3.12.10
}
addItem
public abstract void addItem(String  item, int  index)
- Adds the specified string to the scrolling list at the specified position.
- The index argument is 0-based. If the index is -1, or greater than or equal 
to the number of items already in the list, then the item is added at the end 
of the list.
- Parameters:
 item
- the string to be added
index
- the position at which to put in the item
  
clear
public abstract void clear()
- Removes all items from the scrolling list.
- See Also:
 - delItems  (II-§3.12.3).
 
 
delItems
public abstract void delItems(int  start, int  end)
- Deletes the items in the range 
 from the scrolling 
list.
- Parameters:
 start
- the index of the first element to delete
end
- the index of the last element to delete
 
deselect
public abstract void deselect(int  index)
- Deselects the item at the specified index. 
- Parameters:
 index
- the position of the item to deselect
- See Also:
 - select  (II-§3.12.9).
 
 
getSelectedIndexes
public abstract int[] getSelectedIndexes()
- Returns:
 - an array of the selected indexes on the scrolling list.
 - See Also:
 - select  (II-§3.12.9)
deselect  (II-§3.12.4).
 
makeVisible
public abstract void makeVisible(int  index)
- Forces the item at the specified index to be visible.
 
minimumSize
public abstract Dimension minimumSize(int  v)
- Parameters:
 rows
- number of rows
- Returns:
 - the minimum dimensions needed to display the specified number of 
rows in a scrolling list.
 
preferredSize
public abstract Dimension preferredSize(int  v)
- Parameters:
 rows
- number of rows
- Returns:
 - the preferred dimensions needed to display the specified number of 
rows in a scrolling list.
 
select
public abstract void select(int  index)
- Selects the item at the specified index.
- Parameters:
 index
- the position of the item to select
- See Also:
 - deselect  (II-§3.12.4).
 
 
setMultipleSelections
public abstract void setMultipleSelections(boolean  v)
- Sets whether this scolling list allows multiple selections.
- Parameters:
 v
- if true then multiple selections are allowed; otherwise, only one item 
can be selected at a time
 
Packages  This Package  Prev  Next  Index
Java API Document (HTML generated by dkramer on April 22, 1996)
Copyright © 1996 Sun Microsystems, Inc.
All rights reserved
Please send any comments or corrections to doug.kramer@sun.com