Hi everybody, I'm new to GUI and was wondering if someone could help me with my fraction calculator if they input text in the fields or if they leave something blank. I'm not quite sure how to do that. Here's my code, and if someone could guide me to how to do it, I'd be very thankful.
fractionNumeratorOne = (int)(Integer.parseInt(firstNumerator.getText()));
fractionDenominatorOne = (int)(Integer.parseInt(firstDenominator.getText()));
fractionNumeratorTwo = (int)(Integer.parseInt(secondNumerator.getText()));
fractionDenominatorTwo = (int)(Integer.parseInt(secondDenominator.getText()));
if (fractionDenominatorOne==0 || fractionDenominatorTwo==0)
{
JOptionPane.showMessageDialog(null, "Zero isn't the right number, it will equal a positive infinity","Error", JOptionPane.ERROR_MESSAGE);
}
[B] if(fractionNumeratorOne==)[/B] {
JOptionPane.showMessageDialog(null, "Zero isn't the right number, it will equal a positive infinity","Error", JOptionPane.ERROR_MESSAGE);
}