Hi, I'm new to Java programing started learning it today. And have a bit of a problem.
Then clicking button program converting Celsius to Fahrenheit and vice versa.
I need to check 'CelsijusTextField' if it's not empty then program converting Celsius to Fahrenheit and
if 'FarenheitasTextField' is not empty program converts Fahrenheit to Celsius.
int Celsijus = (int)((Double.parseDouble(CelsijusTextField.getText()))); int Farenheitas = (int)((Double.parseDouble(FarenheitasTextField.getText()))); if (Celsijus != 0) { FarenheitasTextField.setText(Celsijus * 1.8 + 32 + ""); } else if (Farenheitas != 0) { CelsijusTextField.setText((Farenheitas - 32 / 1.8) + ""); }