1 17 18 package counter.listeners; 19 20 import Jmc.baseGui.*; 21 import Jmc.baseTools.*; 22 import Jmc.commonGui.*; 23 24 33 public class Counter_li implements base_guiListener 34 { 35 private int pem_cnt = 0; 36 45 public void pcmf_execListener(base_guiObj xParam) throws Exception 46 { 47 base_guiWidget_if l_disp = (base_guiWidget_if)base_registredObject.pcmf_getObjByName("display"); 49 50 String l_value = (String )xParam.pcmf_getValue(); 52 53 if (l_value.equals("inc (+)")) 54 this.pem_cnt ++; 55 else 56 if (l_value.equals("dec (-)")) 57 this.pem_cnt --; 58 else 59 if (l_value.equals("reset")) 60 this.pem_cnt = 0; 61 62 l_disp.pcmf_setValue(Integer.toString(this.pem_cnt)); 64 65 l_disp.pcmf_repaint(); 67 68 return; 69 } 70 } | Popular Tags |