home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / prosrc.bin / RadioButton.java < prev    next >
Encoding:
Java Source  |  1998-03-18  |  1.4 KB  |  50 lines

  1. /*
  2.  * @(#RadioButton.java
  3.  *
  4.  * Copyright (c) 1997 Symantec Corporation. All Rights Reserved.
  5.  *
  6.  */
  7.  
  8.  
  9. package symantec.itools.db.awt;
  10.  
  11. /**
  12.  * A dbAWARE Checkbox component.
  13.  * <p>
  14.  * This component is similar to the basic Checkbox component, but can
  15.  * be "bound" to a projection within a relation view
  16.  * so that it automatically gets and sets the values in that relation.
  17.  *
  18.  * @see java.awt.CheckboxGroup
  19.  */
  20. public class RadioButton extends java.awt.Checkbox
  21. {
  22.  
  23.     /**
  24.      * Constructs a default RadioButton.
  25.      * By default the label will read: "<dbAWARE RadioButton>".
  26.      */
  27.     public RadioButton()
  28.     {
  29.         super.setLabel("<dbAWARE RadioButton>");
  30.     }
  31.  
  32.     /**
  33.      * Constructs a RadioButton with the given label that belongs to the specified
  34.      * RadioBox and has a specific initial value.
  35.      * This call automatically binds this RadioButton to the same RelationView and
  36.      * projection that the RadioBox is bound with.
  37.      *
  38.      * @param label the label for this component
  39.      * @param group the RadioBox this component belongs to
  40.      * @param state the initial value of this component
  41.      */
  42.     public RadioButton(String label, java.awt.CheckboxGroup group, boolean state)
  43.     {
  44.         super(label, group, state);
  45.         if (group instanceof RadioBox) {
  46.             ((RadioBox)group).addCheckbox(this);
  47.         }
  48.     }
  49. }
  50.