Need help rounding. MoPay.setText
is showing up as .########### (I'm new to this language.) Oh, and my dollar sign isn't showing up, does anyone no why?
public void actionPerformed(ActionEvent e)
{
int Mort;
double Int;
int T;
if(e.getSource()==Reset)
{
answer.setText("");
answera.setText("");
answerb.setText("");
MoPay.setText("");
}
else if(e.getSource()==Calculate)
{
try {
Mort = Integer.parseInt(answer.getText());
Int = Double.parseDouble(answera.getText());
T = Integer.parseInt(answerb.getText());
MoPay.setText("$" + (Int - (Mort * Int * T)) / (T*12));
}
catch(java.lang.NumberFormatException NFE)
{
Mort = 0;
Int = 0;
T = 0;
}
}
}