Back to index

wims  3.65+svn20090927
CheckboxAction.java
Go to the documentation of this file.
00001 package rene.gui;
00002 
00003 import java.awt.Checkbox;
00004 import java.awt.event.ItemEvent;
00005 import java.awt.event.ItemListener;
00006 
00007 class CheckboxActionTranslator implements ItemListener
00008 {   DoActionListener C;
00009     String S;
00010     public Checkbox CB;
00011     public CheckboxActionTranslator
00012         (Checkbox cb, DoActionListener c, String s)
00013     {   C=c; S=s; CB=cb;
00014     }
00015     public void itemStateChanged (ItemEvent e)
00016     {   C.itemAction(S,CB.getState());
00017     }
00018 }
00019 
00026 public class CheckboxAction extends Checkbox
00027 {   public CheckboxAction (DoActionListener c, String s)
00028     {   super(s);
00029        if (Global.NormalFont!=null) setFont(Global.NormalFont);
00030         addItemListener(new CheckboxActionTranslator(this,c,s));
00031     }
00032     public CheckboxAction (DoActionListener c, String s, String h)
00033     {   super(s);
00034        if (Global.NormalFont!=null) setFont(Global.NormalFont);
00035         addItemListener(new CheckboxActionTranslator(this,c,h));
00036     }
00037 }