java awt 选择框
The Choice class provides a pop-up menu to the user. The user is capable of choosing one of the options from the list. The selected item appears at the top. This class is often used when there is a large number of options to choose from and not a lot of space available to display all the items on the screen.
Choice类向用户提供一个弹出菜单。 用户能够从列表中选择选项之一。 所选项目显示在顶部。 当有很多选项可供选择并且没有足够的空间来显示屏幕上的所有项目时,通常使用此类。
We can program to interact with the Choice object at runtime, by implementing the ItemListener interface. The class is capable of firing the ItemEvent objects, which we can handle by assigning an ItemListener. We will discuss more event handling in later sections.
通过实现ItemListener接口,我们可以编程在运行时与Choice对象进行交互。 该类能够触发ItemEvent对象,我们可以通过分配ItemListener来处理该对象。 我们将在后面的部分中讨论更多的事件