本文整理汇总了Java中java.awt.peer.ChoicePeer.select方法的典型用法代码示例。如果您正苦于以下问题:Java ChoicePeer.select方法的具体用法?Java ChoicePeer.select怎么用?Java ChoicePeer.select使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.peer.ChoicePeer
的用法示例。
在下文中一共展示了ChoicePeer.select方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: select
import java.awt.peer.ChoicePeer; //导入方法依赖的package包/类
/**
* Sets the selected item in this <code>Choice</code> menu to be the
* item at the specified position.
*
* <p>Note that this method should be primarily used to
* initially select an item in this component.
* Programmatically calling this method will <i>not</i> trigger
* an <code>ItemEvent</code>. The only way to trigger an
* <code>ItemEvent</code> is by user interaction.
*
* @param pos the position of the selected item
* @exception IllegalArgumentException if the specified
* position is greater than the
* number of items or less than zero
* @see #getSelectedItem
* @see #getSelectedIndex
*/
public synchronized void select(int pos) {
if ((pos >= pItems.size()) || (pos < 0)) {
throw new IllegalArgumentException("illegal Choice item position: " + pos);
}
if (pItems.size() > 0) {
selectedIndex = pos;
ChoicePeer peer = (ChoicePeer)this.peer;
if (peer != null) {
peer.select(pos);
}
}
}
示例2: select
import java.awt.peer.ChoicePeer; //导入方法依赖的package包/类
/**
* Sets the selected item in this {@code Choice} menu to be the
* item at the specified position.
*
* <p>Note that this method should be primarily used to
* initially select an item in this component.
* Programmatically calling this method will <i>not</i> trigger
* an {@code ItemEvent}. The only way to trigger an
* {@code ItemEvent} is by user interaction.
*
* @param pos the position of the selected item
* @exception IllegalArgumentException if the specified
* position is greater than the
* number of items or less than zero
* @see #getSelectedItem
* @see #getSelectedIndex
*/
public synchronized void select(int pos) {
if ((pos >= pItems.size()) || (pos < 0)) {
throw new IllegalArgumentException("illegal Choice item position: " + pos);
}
if (pItems.size() > 0) {
selectedIndex = pos;
ChoicePeer peer = (ChoicePeer)this.peer;
if (peer != null) {
peer.select(pos);
}
}
}
示例3: select
import java.awt.peer.ChoicePeer; //导入方法依赖的package包/类
/**
* Sets the selected item in this <code>Choice</code> menu to be the
* item at the specified position.
*
* <p>Note that this method should be primarily used to
* initially select an item in this component.
* Programmatically calling this method will <i>not</i> trigger
* an <code>ItemEvent</code>. The only way to trigger an
* <code>ItemEvent</code> is by user interaction.
*
* @param pos the positon of the selected item
* @exception IllegalArgumentException if the specified
* position is greater than the
* number of items or less than zero
* @see #getSelectedItem
* @see #getSelectedIndex
*/
public synchronized void select(int pos) {
if ((pos >= pItems.size()) || (pos < 0)) {
throw new IllegalArgumentException("illegal Choice item position: " + pos);
}
if (pItems.size() > 0) {
selectedIndex = pos;
ChoicePeer peer = (ChoicePeer)this.peer;
if (peer != null) {
peer.select(pos);
}
}
}
示例4: select
import java.awt.peer.ChoicePeer; //导入方法依赖的package包/类
/**
* Sets the selected item in this <code>Choice</code> menu to be the
* item at the specified position.
*
* <p>Note that this method should be primarily used to
* initially select an item in this component.
* Programmatically calling this method will <i>not</i> trigger
* an <code>ItemEvent</code>. The only way to trigger an
* <code>ItemEvent</code> is by user interaction.
*
* @param pos the positon of the selected item
* @exception IllegalArgumentException if the specified
* position is greater than the
* number of items or less than zero
* @see #getSelectedItem
* @see #getSelectedIndex
*/
public synchronized void select(int pos) {
if ((pos >= pItems.size()) || (pos < 0)) {
throw new IllegalArgumentException("illegal Choice item position: " + pos);
}
if (pItems.size() > 0) {
selectedIndex = pos;
ChoicePeer peer = (ChoicePeer)this.peer;
if (peer != null) {
peer.select(pos);
}
}
}