I have an assignment for my Java beginners class where I have to code the + JButton, -JButton, * JButton,and the / JButton. Only problem is I'm not sure how to start it. I know I have to obtain the user input from the first number JTextField and the second number JTextField. I've forgotten how to obtain that though. I'm thinking it's something like firstNumberJTextField.getText (); but when I do that NetBeans just throws up a red error box.
That's where I have to write the code to obtain the user input from both number JTextFields. I have to convert those numbers to int values and assign the number to int variables number1 and number2. Then I have to add the numbers and assign the result to the int variable result. Then display that number in the resultJtextField.
Much appreciated if anyone can help me with this.