    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);

##

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

##

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

##

JCChoice

     public JCChoice()

  Constructs an empty Component.

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

##

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.

getValue

     public int getValue()

  Returns the value corresponding to the current choice.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index