Java AWT

Previous Chapter 23
java.awt.peer Reference
  Next
 

ChoicePeer

Name

ChoicePeer

[Graphic: Figure from the text]

Description

ChoicePeer is an interface that defines the basis for choice components.

Interface Definition

public abstract interface java.awt.peer.ChoicePeer
   extends java.awt.peer.ComponentPeer {
  // Interface Methods
  public abstract void add (String item, int index); (New)
  public abstract void addItem (String item, int position); (Deprecated)
  public abstract void remove (int index); (New)
  public abstract void select (int position);
}

Interface Methods

add

public abstract void add (String item, int index) (New)

Parameters

item

Text of the entry to add.

index

Position in which to add the entry; position 0 is the first entry in the list.

Description

Adds a new entry to the available choices at the designated position.

addItem

public abstract void addItem (String item, int position) (Deprecated)

Parameters

item

Text of the entry to add.

position

Position in which to add the entry; position 0 is the first entry in the list.

Description

Adds a new entry to the available choices at the designated position.

remove

public abstract void remove (int index) (New)

Parameters

index

Position of the item to remove.

Description

Removes an entry at the given position.

select

public abstract void select (int position)

Parameters

position

Position to make selected entry.

Description

Makes the given entry the selected one for the choice's peer.

See Also

ComponentPeer, String


Previous Home   Next
CheckboxPeer Book Index   ComponentPeer

Java in a Nutshell Java Language Reference Java AWT Java Fundamental Classes Exploring Java