Thanks for that. Yes the code is cleaner now, you're right, but it's kind of difficult for me to get that separation because I do a console program first and then turn that into the proper GUI application. Also, another thing to say is the way I was taught - which it was probably wrong I can see now :-) - which is, having a file (xxxTest.java) that takes care of the GUI window only and the rest goes into the other file

Whatever your teacher says, even if it's wrong, is what you have to do, as long as your teacher is grading your work! (yes, it sucks, but that's life)

The idea of separating UI and logic goes right from the beginning. That's just as valid for a console UI. If you start with separate code for the console UI and the logic then it will be so much easier to add a GUI later. You don't have to have two files if that would confuse your teacher. You can put console UI and logic in the same file and have all the UI methods at the beginning, followed by all the logic methods. Then your GUI calls the logic methods and ignores the console methods.

cool thanks for that (sorry for the slow response been really busy with work and other things!)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.