JTextField
even if it does not
have a listener.
getText()
The complete application (when we finish with it) is 80 lines long. All this to implement a one-line formula! For short applications, this is typical. But for longer applications the percentage of code for the GUI part is about 40%.
Let us build the interface part of the program. Look at the GUI on the right to determine what should go into the program. Click the buttons to see if you are correct.