Package java.awt.peer |
![]() Previous |
![]() Java API |
![]() Index |
![]() Next |
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 { // Methods public abstract void addItem(String item, int index); public abstract void clear(); public abstract void delItems(int start, int end) public abstract void deselect(int index); public abstract int[] getSelectedIndexes(); public abstract void makeVisible(int index); public abstract Dimension minimumSize(int v); public abstract Dimension preferredSize(int v); public abstract void select(int index); public abstract void setMultipleSelections(boolean v); }
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.
Parameter Description item the string to be added index the position at which to put in the item
public abstract void clear()Removes all items from the scrolling list.
See Also: delItems .
public abstract void delItems(int start, int end)Deletes the items in the range start £ item £ end from the scrolling list.
Parameter Description start the index of the first element to delete end the index of the last element to delete
public abstract void deselect(int index)Deselects the item at the specified index.
Parameter Description index the position of the item to deselect See Also: select .
public abstract int[] getSelectedIndexes()Return Value:
Returns an array of the selected indexes on the scrolling list.
public abstract void makeVisible(int index)Forces the item at the specified index to be visible.
public abstract Dimension minimumSize(int v)Return Value:
Returns the minimum dimensions needed to display the specified number of rows in a scrolling list.
Parameter Description rows number of rows
public abstract Dimension preferredSize(int v)Return Value:
Returns the preferred dimensions needed to display the specified number of rows in a scrolling list.
Parameter Description rows number of rows
public abstract void select(int index)Selects the item at the specified index.
Parameter Description index the position of the item to select See Also: deselect .
public abstract void setMultipleSelections(boolean v)Sets whether this scolling list allows multiple selections.
Parameter Description v if true then multiple selections are allowed; otherwise, only one item can be selected at a time