All you really need is an inner class that implements ActionListener, add the actionPerformed method, and within it, obtain the user's inputs and display the answer. Example:




import...