I voted for the Code Kata answer which I think is awesome, but even more generally--
NOTHING will help more than re-writing your code over and over again. Even at work, take the time to make 2 or 3 passes through all your code.
If you are having a lot of trouble with some code you wrote, toss it all and re-write it. Make a lifetime habit of rewriting code. (Don't worry about speed either, just rewrite it until it works smoothly and you're comfortable with the implementation).
Always take time to craft your code. Your ultimate goal is DRY. This doesn't mean don't write the same code twice, it means you don't have the same logic in two places in your code EVER. Even code like this:
String name;
String age;
JTextArea aName=new JTextArea();
JTextArea aAge=new JTextArea();
frame.add(aName);
frame.add(aAge);
...
should drive you ABSOLUTELY NUTS. Look at the pattern in your code. ABSTRACT that crap out--refactor it until you have only one place that instantiates text area, one place that copies a value into the text area and one place that removes it and stores it.
Always look for patterns like this and try to figure out ways to eliminate them. It's likely that you will have to go to reflection--you will certainly need meta-data. Get comfortable with the idea.
Write it the way you might normally do it (the way I just did), make it work, then start refactoring with a working, tested model. I've removed 4/5 to 9/10 of files like this and changed them into simple data-driven systems where it's much harder for a bug to slip in (almost impossible since each path is so well-tested, it's used repeatedly for every run!
Honestly nothing has made as big a difference in my career as my resistance to duplicate code.