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

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -