Package java.awt.peer Previous
Previous
Java API
Java API
Index
Index
Next
Next

Interface ListPeer

Methods

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);	
}


Methods


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.

ParameterDescription
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 .


delItems

public abstract void delItems(int  start, int  end) 

Deletes the items in the range start £ item £ end from the scrolling list.

ParameterDescription
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.

ParameterDescription
index the position of the item to deselect

See Also: select .


getSelectedIndexes

public abstract int[] getSelectedIndexes() 

Return Value:

Returns an array of the selected indexes on the scrolling list.

See Also: select deselect .


makeVisible

public abstract void makeVisible(int  index) 

Forces the item at the specified index to be visible.


minimumSize

public abstract Dimension minimumSize(int  v) 

Return Value:

Returns the minimum dimensions needed to display the specified number of rows in a scrolling list.

ParameterDescription
rows number of rows


preferredSize

public abstract Dimension preferredSize(int  v) 

Return Value:

Returns the preferred dimensions needed to display the specified number of rows in a scrolling list.

ParameterDescription
rows number of rows


select

public abstract void select(int  index) 

Selects the item at the specified index.

ParameterDescription
index the position of the item to select

See Also: deselect .


setMultipleSelections

public abstract void setMultipleSelections(boolean  v) 

Sets whether this scolling list allows multiple selections.

ParameterDescription
v if true then multiple selections are allowed; otherwise, only one item can be selected at a time



Top© 1996 Sun Microsystems, Inc. All rights reserved.