Ok. So, I don't know which class from javax.swing to use for this. I think it's JTextField, but anyway...
I'm looking for a class that allows the user to type in, in this case, integer or double values, which I'll be able to take as a string, change to type I need, then perform operations with them.
Example: 3 text fields. Miles, Gallons, and MPG. If the user puts in info for Miles, and Gallons, I should be able to take the user input, do my operation, then display the result (value for MPG) in the MPG text box.
If it's the JTextField class, I don't know which methods to use for reading the input in the box or the method to display new text in the box after its initial construction.
If anyone can help, it would be greatly appreciated.
I'm looking for a class that allows the user to type in, in this case, integer or double values, which I'll be able to take as a string, change to type I need, then perform operations with them.
Example: 3 text fields. Miles, Gallons, and MPG. If the user puts in info for Miles, and Gallons, I should be able to take the user input, do my operation, then display the result (value for MPG) in the MPG text box.
If it's the JTextField class, I don't know which methods to use for reading the input in the box or the method to display new text in the box after its initial construction.
If anyone can help, it would be greatly appreciated.
Comment