If all you have is a hammer, everything will look like a nail.
Over the past few days I have spent adding features to my personal money management application, in particular a way to add account information to monitor you personal account balances. However, the task has highlighted my shortcomings when it comes to designing a UI for the application. My ability to build Swing interfaces is quite limited, having no formal training or invested much time to learn Swing in any more detail than a few basic buttons and panels.
This became fairly obvious when I found myself re-using only the tools I know, when clearly other tools must exist that are more effective for the task at hand.
Also it has come to my attention that while there are tutorials and books on how to ”use” Swing components, and books and tutorials on good UI design. There is an apparent chasm where the two should meet. After all, there are books on programming languages, and books on what good software looks like, but there are also many books in between that teach about encapsulation, coupling, cohesion, design patterns etc. With Swing there doesn’t appear to be many books that provide the heuristics of making good Swing UIs.
The only thing guiding me at the moment is plain old object analysis and design, decoupling my UI from my model, and keeping the code decoupled and flexible. However, I also find myself doing things I would ordinarily consider ”strange”. For example, to get the layout I want I have heavily nested Panels and LayoutManagers. Is this normal? Or am I just abusing the tools that I know? Like the opening quote would suggest, I feel like all I have is a hammer, and I am just using the same tool to make things work.
I suppose what I am looking for is a text on Swing ”best practices”’, or a few examples of what a well designed and developed Swing UI ”should” look like. I’m sure I could craft my own flexible design with enough study, experimentation, and time. But all I’ll be doing is re-inventing the wheel – which to me just seems like wasted time and energy, especially when I know a solution should already exist. I just need to find it.
I suppose that now that I have made several attempts at the task, now would be a good time to invest in learning about Swing and all it has to offer, as well as figuring out what a truly well designed Swing UI should look like.