|
Re: adding text fields
|
Posted: Apr 20, 2005 10:49 PM
|
|
You can't add Objects. That would be like adding one chair to another. What's a TextBox by the way? In Java we have TextFields, TextAreas, ... but no TextBox. You probably mean JTextField.
Should this be a mathematical operation?
The methods you need are getText(), Double.parseDouble(), setText().
Use getText() to get the content of the other fields. Use parseDouble() to convert the String to a number. Then calculate your new value, at the end use setText() to set the content of the new "TextBox"
|
|