当前位置: 首页>>代码示例>>Java>>正文


Java ChoicePeer.select方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:Choice.java

示例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);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:Choice.java

示例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);
    }
}
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:30,代码来源:Choice.java

示例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);
        }
    }
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:30,代码来源:Choice.java


注:本文中的java.awt.peer.ChoicePeer.select方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。