All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jclass.contrib.JCChoice

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Choice
                   |
                   +----jclass.contrib.JCChoice

public class JCChoice
extends Choice
JCChoice extends the AWT Choice class to associate values with the chosen items. The following is an example of how it can be used:

  String bTypeStrings[] = { "Shadow In", "Shadow Out", "Etched In" };
  JCChoice bTypeC;
  int bTypeValues[] = { JCEnum.BORDER_IN, JCEnum.BORDER_OUT,
                        JCEnum.BORDER_ETCHED_IN };
  bTypeC = new JCChoice(bTypeStrings, bTypeValues);
  bTypeC.setCurrent(JCEnum.BORDER_OUT);
 


Constructor Index

 o JCChoice()
Constructs an empty Component.
 o JCChoice(String[], int[])
This constructor takes an array of strings for the individual items and an array of values to associate with the strings.

Method Index

 o getValue()
Returns the value corresponding to the current choice.
 o setValue(int)
When a JCChoice is created, it is given an array of values to associate with each choice string.

Constructors

 o JCChoice
  public JCChoice()
Constructs an empty Component.

 o JCChoice
  public JCChoice(String items[],
                  int vals[])
This constructor takes an array of strings for the individual items and an array of values to associate with the strings.

Parameters:
items - an array of strings to appear in the choice
vals - the values to be associated with each choice

Methods

 o setValue
  public void setValue(int value)
When a JCChoice is created, it is given an array of values to associate with each choice string. This function takes a value and sets the current item in the choice to be the item associated with the value.

 o getValue
  public int getValue()
Returns the value corresponding to the current choice.


All Packages  Class Hierarchy  This Package  Previous  Next  Index