Hi guys. I implemented my GUI in such way that I have the same JFrame for the server, standalone client, and network client. So depending on the mode of the program this JFrame chooses to show some fields and labels or not to show them. I read something simalar in the Andrews book, he used common panel for all modes.
But I'm using not the panel, but a frame and this means that inside the ActionListener of the start button I use case operator to determine the mode of the program and then start server or open the main window etc.
So How do you think is it a bad design and it's better to implement 3 separate frames(though they will use a lot of similar JTextFields and labels ... ) for server, client and network client with 3 separate ActionListeners
What I had was an abstract config view (which contained all common code) with 3 subclasses, and used the State design pattern for instantiating one of these subclasses.
Both my config and client views were directly inheriting from JFrame.
What I used was only one frame and three panels, but on this three panels I had common code so I used the Template Method Pattern to put all the common code in an abstrac class and I just set the code that changed in subclasses. I used Panels because I believe they are easier to change than frames.
By the way I do not mean changing code or maintenance, I tried to say change from one panel to another (like from the configuration panel to the main panel that contains the search criteria and all that stuff).