Geoff Jefferson wrote:You have declared many members (variables).
Have you assigned anything to them?
Take a look at:
http://download.oracle.com/javase/tutorial/java/javaOO/classvars.html
G.
If you are a beginner, that is a serious mistake. Write all your code by hand until you are used to writing GUI code. That is why you have those poorly-named fields. Why are those fields of the class in the first place? You can probably make them all local variables in your GUI constructor or setUpGUI method. Beware of NetBeans here; if you try to change those fields, it will simply change the list backMichael Humphreys wrote: . . . I have used net beans to build a GUI for my program. . . .
No, you haven't. You have written 67 lines of GUI code (or more precisely, told an IDE to write 67 lines). It has at present no connection to your old non-GUI code, which did actually work. You still have a few things wrong, eg using == true and yield - cost < 0.00. The first should be omitted altogether, and latter should read yield < cost. Alternatively, you should work out a profit variable and then test whether Math.abs(profit) < 0.005 or profit < 0, etc. Then you can print profit to screen. You also seem to have incorrect indentation, and a cost local variable which you never use.Michael Humphreys wrote: . . . I should bite off smaller bites. The way I set up my studies I started with a basic program then added to it progressively until I reached the point I am at now. . . .