That calculating interest method looks untidy. Why are you using floatss in the first place, and why have you got so many local variables. You cannot get that to work with the GUI because it is not an interest-calculating class. It is a procedure. You need to get rid of that procedure and create a class which can calculate interest. You might call it Loan. Get it working from the command line and only consider the GUI after you have got that working correctly.