java - How to calculate a value from an action listener -
i building program gui , trying program calculate if driver on or under limit. using action listener in order read user going type in.
public void calculation() { if(txtspeed > txtlimit){ system.out.println("the dirver on limit"); } else{ system.out.println("the driver under limit"); } class vhlimithandler implements actionlistener{ public void actionperformed(actionevent event){ txtlimit = double.parsedouble(textlimit.gettext()); } } class vhspeedhandler implements actionlistener{ public void actionperformed(actionevent event){ txtspeed = double.parsedouble(textspeed.gettext());
Comments
Post a Comment