I’m writing a GUI for an application using Swing, and in the interests of code maintenance and readability, I want to follow a consistent pattern throughout the whole system.
Most of the articles and books (or at least book sections) that I’ve read appear to provide plenty of examples on how to create and arrange various components, but ignore the bigger picture of writing a full GUI.
What are your best tips for application GUI design, and what patterns do you follow when designing or refactoring a GUI application?
Answer
Use layout managers. You might think it’s simpler just to position everything with hard coded positions now (especially if you use a graphical layout tool), but when it comes time to update the gui, or internationalize it, your successors will hate you. (Trust me on this, I was the guy saying to use the layout managers from the start, and the successor to the guy who ignored me.)