So
tf1 is a JTextField or something like that? (It helps if you tell us what's actually happening instead of using general terms like "text box".) Anyway, assuming that's the case, then the error message (which
you should have posted rather than giving a general description) is telling you that it doesn't have a
setText(double) method. However you know that it does have a
setText(String) method, it appears. So there's only a small gap to bridge there. Namely, you just have to convert your double to a String and then pass that String value to the
setText method.