Logo Search packages:      
Sourcecode: wims version File versions

CheckboxMenu.java

package rene.gui;

import java.awt.CheckboxMenuItem;
import java.util.Vector;

class CheckboxMenuElement
{     public String Tag;
      public CheckboxMenuItem Item;
      public CheckboxMenuElement (CheckboxMenuItem i, String tag)
      {     Item=i; Tag=tag;
      }
}

public class CheckboxMenu
{     Vector V;
      public CheckboxMenu ()
      {     V=new Vector();
      }
      public void add (CheckboxMenuItem i, String tag)
      {     V.addElement(new CheckboxMenuElement(i,tag));
      }
      public void set (String tag)
      {     int i;
            for (i=0; i<V.size(); i++)
            {     CheckboxMenuElement e=
                        (CheckboxMenuElement)V.elementAt(i);
                  if (tag.equals(e.Tag)) e.Item.setState(true);
                  else e.Item.setState(false);
            }
      }
}

Generated by  Doxygen 1.6.0   Back to index