I have four classes flight, passenger, seating chart, and waiting list. I'm trying to create a gui. I am new to swing so I dont know how it is done. should I create a separate class for a gui and build all the gui there or should I incorporate my gui code in those already existing classes? how is it implemented if there is a general guideline?
2 Answers
The classes that you mention are model classes; they are used to abstract the data of your system. You should never put your presentation [GUI] code in model classes. You must have separate classes/code for your presentation[GUI].
The general guideline is that :
Separate Presentation, Controller and Model code into different classes. Use the model-view-controller design pattern for your system.
In all programming languages is nice to separate UI and code. It's better to understand and keeps you code clean.