I’ll be cranking out my first serious GUI in Java here over the next few weeks / months. This will be my first project in Java where I’ll hold myself to a very high standard for coding practices and results, so I expect the learning process will take some time.
I’d say I’m not quite a beginner with Java, but more of an intermediate user – getting used to the API, still awkward on a few keywords. I’m comfortable with OOP, mainly through PHP development.
Are there any tips people can think of to help accelerate the learning curve, i.e. “don’t do THAT” or “I wish someone had told me this” type of things.
The first one I came across in a few other questions was a null layout manager – apparently, that’s shoddy programming and leads to trouble down the line. So, that helps me right away, probably saved a week and a few rewrites right there.
Another was use NetBeans to move around in Swing…but I can’t elaborate on that one yet, needs some research.
Are there any other strong recommendations out there?
You might want to check out the following:
JGoodies has the famous FormLayout and other stuff: http://www.jgoodies.com/
SAF JSR-296 implementation fork: http://kenai.com/projects/bsaf/pages/Home
Apache Commons, especially lang, if you don’t use these already, you’re on the wrong track: http://commons.apache.org/
Not sure about SwingX right now, but it seems to be worth looking at as well: Does anyone use the "swingx" extensions to Swing?
Java practices, general good stuff: http://www.javapractices.com
You should definitely look into using existing frameworks and tools. It helps to read a lot up front to get a picture instead of delving into writing much yourself. There’s almost anything that exists except a library for common translations in desktop apps, e.g. for common actions (menu items).
Edit: Ah and don’t forget the SwingWorker…