APIdia Launch Partner
Top Description Fields Methods
java.awt.peer

public Interface ListPeer

extends ComponentPeer
Known Direct Implementers
sun.awt.X11.XListPeer
Imports
java.awt.Dimension, .List

The peer interface for List. The peer interfaces are intended only for use in porting the AWT. They are not intended for use by application developers, and developers should not implement peers nor invoke any of the peer methods directly on the peer instances.

Field Summary

Inherited from java.awt.peer.ComponentPeer:
DEFAULT_OPERATIONNO_EMBEDDED_CHECKRESET_OPERATIONSET_BOUNDSSET_CLIENT_SIZESET_LOCATIONSET_SIZE

Method Summary

Modifier and TypeMethod and Description
public void
add(String
the item to add to the list
item
,
int
the index where to add the item into the list
index
)

Adds an item to the list at the specified index.

public void
delItems(int
the first item to be deleted
start
,
int
the last item to be deleted
end
)

Deletes items from the list.

public void
deselect(int
the index of the item to de-select
index
)

De-selects the item at the specified index.

public Dimension

Returns:

the minimum size of the list
getMinimumSize
(int
the number of rows
rows
)

Returns the minimum size for a list with the specified number of rows.

public Dimension

Returns:

the preferred size of the list
getPreferredSize
(int
the number of rows
rows
)

Returns the preferred size for a list with the specified number of rows.

public int[]

Returns:

the indices of the list items that are currently selected
getSelectedIndexes
()

Returns the indices of the list items that are currently selected.

public void
makeVisible(int
the index of the item to make visible
index
)

Makes sure that the item at the specified index is visible, by scrolling the list or similar.

public void
removeAll()

Removes all items from the list.

public void
select(int
the index of the item to select
index
)

Selects the item at the specified index.

public void
setMultipleMode(boolean
true for multiple selection mode, false for single selection mode
m
)

Toggles multiple selection mode on or off.

Inherited from java.awt.peer.ComponentPeer:
applyShapecanDetermineObscuritycoalescePaintEventcreateBufferscreateImagecreateVolatileImagedestroyBuffersdisposeflipgetBackBuffergetColorModelgetFontMetricsgetGraphicsgetGraphicsConfigurationgetLocationOnScreengetMinimumSizegetPreferredSizehandleEventhandlesWheelScrollingisFocusableisObscuredisReparentSupportedlayoutpaintprintreparentrequestFocussetBackgroundsetBoundssetEnabledsetFontsetForegroundsetVisiblesetZOrderupdateCursorImmediatelyupdateGraphicsData

Method Detail

addback to summary
public void add(String item, int index)

Adds an item to the list at the specified index.

Parameters
item:String

the item to add to the list

index:int

the index where to add the item into the list

See Also
List#add(String, int)
delItemsback to summary
public void delItems(int start, int end)

Deletes items from the list. All items from start to end should are deleted, including the item at the start and end indices.

Parameters
start:int

the first item to be deleted

end:int

the last item to be deleted

deselectback to summary
public void deselect(int index)

De-selects the item at the specified index.

Parameters
index:int

the index of the item to de-select

See Also
List#deselect(int)
getMinimumSizeback to summary
public Dimension getMinimumSize(int rows)

Returns the minimum size for a list with the specified number of rows.

Parameters
rows:int

the number of rows

Returns:Dimension

the minimum size of the list

See Also
List#getMinimumSize(int)
getPreferredSizeback to summary
public Dimension getPreferredSize(int rows)

Returns the preferred size for a list with the specified number of rows.

Parameters
rows:int

the number of rows

Returns:Dimension

the preferred size of the list

See Also
List#getPreferredSize(int)
getSelectedIndexesback to summary
public int[] getSelectedIndexes()

Returns the indices of the list items that are currently selected. The returned array is not required to be a copy, the callers of this method already make sure it is not modified.

Returns:int[]

the indices of the list items that are currently selected

See Also
List#getSelectedIndexes()
makeVisibleback to summary
public void makeVisible(int index)

Makes sure that the item at the specified index is visible, by scrolling the list or similar.

Parameters
index:int

the index of the item to make visible

See Also
List#makeVisible(int)
removeAllback to summary
public void removeAll()

Removes all items from the list.

See Also
List#removeAll()
selectback to summary
public void select(int index)

Selects the item at the specified index.

Parameters
index:int

the index of the item to select

See Also
List#select(int)
setMultipleModeback to summary
public void setMultipleMode(boolean m)

Toggles multiple selection mode on or off.

Parameters
m:boolean

true for multiple selection mode, false for single selection mode

See Also
List#setMultipleMode(boolean)