Here's a method that REALLY works (tested on Windows Vista) :D
frame.setExtendedState(JFrame.ICONIFIED);
frame.setExtendedState(fullscreen ? JFrame.MAXIMIZED_BOTH : JFrame.NORMAL);
The fullscreen variable indicates if you want the app to run full screen or windowed.
This does not flash the task bar, but bring the window to front reliably.